Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6

* master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6: (45 commits)
  [IPV4]: Restore multipath routing after rt_next changes.
  [XFRM] IPV6: Fix outbound RO transformation which is broken by IPsec tunnel patch.
  [NET]: Reorder fields of struct dst_entry
  [DECNET]: Convert decnet route to use the new dst_entry 'next' pointer
  [IPV6]: Convert ipv6 route to use the new dst_entry 'next' pointer
  [IPV4]: Convert ipv4 route to use the new dst_entry 'next' pointer
  [NET]: Introduce union in struct dst_entry to hold 'next' pointer
  [DECNET]: fix misannotation of linkinfo_dn
  [DECNET]: FRA_{DST,SRC} are le16 for decnet
  [UDP]: UDP can use sk_hash to speedup lookups
  [NET]: Fix whitespace errors.
  [NET] XFRM: Fix whitespace errors.
  [NET] X25: Fix whitespace errors.
  [NET] WANROUTER: Fix whitespace errors.
  [NET] UNIX: Fix whitespace errors.
  [NET] TIPC: Fix whitespace errors.
  [NET] SUNRPC: Fix whitespace errors.
  [NET] SCTP: Fix whitespace errors.
  [NET] SCHED: Fix whitespace errors.
  [NET] RXRPC: Fix whitespace errors.
  ...
This commit is contained in:
Linus Torvalds
2007-02-11 11:38:13 -08:00
539 changed files with 9009 additions and 9004 deletions

View File

@@ -68,9 +68,10 @@ extern void dn_rt_cache_flush(int delay);
struct dn_route { struct dn_route {
union { union {
struct dst_entry dst; struct dst_entry dst;
struct dn_route *rt_next;
} u; } u;
struct flowi fl;
__le16 rt_saddr; __le16 rt_saddr;
__le16 rt_daddr; __le16 rt_daddr;
__le16 rt_gateway; __le16 rt_gateway;
@@ -80,8 +81,6 @@ struct dn_route {
unsigned rt_flags; unsigned rt_flags;
unsigned rt_type; unsigned rt_type;
struct flowi fl;
}; };
extern void dn_route_init(void); extern void dn_route_init(void);

View File

@@ -37,9 +37,7 @@ struct sk_buff;
struct dst_entry struct dst_entry
{ {
struct dst_entry *next; struct rcu_head rcu_head;
atomic_t __refcnt; /* client references */
int __use;
struct dst_entry *child; struct dst_entry *child;
struct net_device *dev; struct net_device *dev;
short error; short error;
@@ -50,7 +48,6 @@ struct dst_entry
#define DST_NOPOLICY 4 #define DST_NOPOLICY 4
#define DST_NOHASH 8 #define DST_NOHASH 8
#define DST_BALANCED 0x10 #define DST_BALANCED 0x10
unsigned long lastuse;
unsigned long expires; unsigned long expires;
unsigned short header_len; /* more space at head required */ unsigned short header_len; /* more space at head required */
@@ -75,8 +72,16 @@ struct dst_entry
#endif #endif
struct dst_ops *ops; struct dst_ops *ops;
struct rcu_head rcu_head;
unsigned long lastuse;
atomic_t __refcnt; /* client references */
int __use;
union {
struct dst_entry *next;
struct rtable *rt_next;
struct rt6_info *rt6_next;
struct dn_route *dn_next;
};
char info[0]; char info[0];
}; };

View File

@@ -83,7 +83,6 @@ struct rt6_info
{ {
union { union {
struct dst_entry dst; struct dst_entry dst;
struct rt6_info *next;
} u; } u;
struct inet6_dev *rt6i_idev; struct inet6_dev *rt6i_idev;

View File

@@ -53,9 +53,11 @@ struct rtable
union union
{ {
struct dst_entry dst; struct dst_entry dst;
struct rtable *rt_next;
} u; } u;
/* Cache lookup keys */
struct flowi fl;
struct in_device *idev; struct in_device *idev;
unsigned rt_flags; unsigned rt_flags;
@@ -69,9 +71,6 @@ struct rtable
/* Info on neighbour */ /* Info on neighbour */
__be32 rt_gateway; __be32 rt_gateway;
/* Cache lookup keys */
struct flowi fl;
/* Miscellaneous cached information */ /* Miscellaneous cached information */
__be32 rt_spec_dst; /* RFC1122 specific destination */ __be32 rt_spec_dst; /* RFC1122 specific destination */
struct inet_peer *peer; /* long-living peer info */ struct inet_peer *peer; /* long-living peer info */

View File

@@ -117,7 +117,7 @@ module_exit(snap_exit);
*/ */
struct datalink_proto *register_snap_client(unsigned char *desc, struct datalink_proto *register_snap_client(unsigned char *desc,
int (*rcvfunc)(struct sk_buff *, int (*rcvfunc)(struct sk_buff *,
struct net_device *, struct net_device *,
struct packet_type *, struct packet_type *,
struct net_device *)) struct net_device *))
{ {

View File

@@ -195,7 +195,7 @@ __be16 tr_type_trans(struct sk_buff *skb, struct net_device *dev)
skb->mac.raw = skb->data; skb->mac.raw = skb->data;
if(trh->saddr[0] & TR_RII) if(trh->saddr[0] & TR_RII)
riflen = (ntohs(trh->rcf) & TR_RCF_LEN_MASK) >> 8; riflen = (ntohs(trh->rcf) & TR_RCF_LEN_MASK) >> 8;
trllc = (struct trllc *)(skb->data+sizeof(struct trh_hdr)-TR_MAXRIFLEN+riflen); trllc = (struct trllc *)(skb->data+sizeof(struct trh_hdr)-TR_MAXRIFLEN+riflen);
@@ -348,13 +348,13 @@ static void tr_add_rif_info(struct trh_hdr *trh, struct net_device *dev)
* Firstly see if the entry exists * Firstly see if the entry exists
*/ */
if(trh->saddr[0] & TR_RII) if(trh->saddr[0] & TR_RII)
{ {
trh->saddr[0]&=0x7f; trh->saddr[0]&=0x7f;
if (((ntohs(trh->rcf) & TR_RCF_LEN_MASK) >> 8) > 2) if (((ntohs(trh->rcf) & TR_RCF_LEN_MASK) >> 8) > 2)
{ {
rii_p = 1; rii_p = 1;
} }
} }
hash = rif_hash(trh->saddr); hash = rif_hash(trh->saddr);
@@ -365,7 +365,7 @@ static void tr_add_rif_info(struct trh_hdr *trh, struct net_device *dev)
#if TR_SR_DEBUG #if TR_SR_DEBUG
printk("adding rif_entry: addr:%02X:%02X:%02X:%02X:%02X:%02X rcf:%04X\n", printk("adding rif_entry: addr:%02X:%02X:%02X:%02X:%02X:%02X rcf:%04X\n",
trh->saddr[0],trh->saddr[1],trh->saddr[2], trh->saddr[0],trh->saddr[1],trh->saddr[2],
trh->saddr[3],trh->saddr[4],trh->saddr[5], trh->saddr[3],trh->saddr[4],trh->saddr[5],
ntohs(trh->rcf)); ntohs(trh->rcf));
#endif #endif
/* /*
@@ -417,9 +417,9 @@ printk("updating rif_entry: addr:%02X:%02X:%02X:%02X:%02X:%02X rcf:%04X\n",
ntohs(trh->rcf)); ntohs(trh->rcf));
#endif #endif
entry->rcf = trh->rcf & htons((unsigned short)~TR_RCF_BROADCAST_MASK); entry->rcf = trh->rcf & htons((unsigned short)~TR_RCF_BROADCAST_MASK);
memcpy(&(entry->rseg[0]),&(trh->rseg[0]),8*sizeof(unsigned short)); memcpy(&(entry->rseg[0]),&(trh->rseg[0]),8*sizeof(unsigned short));
} }
entry->last_used=jiffies; entry->last_used=jiffies;
} }
trh->saddr[0]=saddr0; /* put the routing indicator back for tcpdump */ trh->saddr[0]=saddr0; /* put the routing indicator back for tcpdump */
spin_unlock_irqrestore(&rif_lock, flags); spin_unlock_irqrestore(&rif_lock, flags);
@@ -541,13 +541,13 @@ static int rif_seq_show(struct seq_file *seq, void *v)
ttl/HZ); ttl/HZ);
if (entry->local_ring) if (entry->local_ring)
seq_puts(seq, "local\n"); seq_puts(seq, "local\n");
else { else {
seq_printf(seq, "%04X", ntohs(entry->rcf)); seq_printf(seq, "%04X", ntohs(entry->rcf));
rcf_len = ((ntohs(entry->rcf) & TR_RCF_LEN_MASK)>>8)-2; rcf_len = ((ntohs(entry->rcf) & TR_RCF_LEN_MASK)>>8)-2;
if (rcf_len) if (rcf_len)
rcf_len >>= 1; rcf_len >>= 1;
for(j = 1; j < rcf_len; j++) { for(j = 1; j < rcf_len; j++) {
if(j==1) { if(j==1) {
segment=ntohs(entry->rseg[j-1])>>4; segment=ntohs(entry->rseg[j-1])>>4;
@@ -559,7 +559,7 @@ static int rif_seq_show(struct seq_file *seq, void *v)
} }
seq_putc(seq, '\n'); seq_putc(seq, '\n');
} }
} }
return 0; return 0;
} }

View File

@@ -184,7 +184,7 @@ struct net_device *__find_vlan_dev(struct net_device *real_dev,
struct vlan_group *grp = __vlan_find_group(real_dev->ifindex); struct vlan_group *grp = __vlan_find_group(real_dev->ifindex);
if (grp) if (grp)
return grp->vlan_devices[VID]; return grp->vlan_devices[VID];
return NULL; return NULL;
} }
@@ -269,7 +269,7 @@ static int unregister_vlan_dev(struct net_device *real_dev,
} }
} }
return ret; return ret;
} }
static int unregister_vlan_device(const char *vlan_IF_name) static int unregister_vlan_device(const char *vlan_IF_name)
@@ -557,8 +557,8 @@ static struct net_device *register_vlan_device(const char *eth_IF_name,
grp->vlan_devices[VLAN_ID] = new_dev; grp->vlan_devices[VLAN_ID] = new_dev;
if (vlan_proc_add_dev(new_dev)<0)/* create it's proc entry */ if (vlan_proc_add_dev(new_dev)<0)/* create it's proc entry */
printk(KERN_WARNING "VLAN: failed to add proc entry for %s\n", printk(KERN_WARNING "VLAN: failed to add proc entry for %s\n",
new_dev->name); new_dev->name);
if (real_dev->features & NETIF_F_HW_VLAN_FILTER) if (real_dev->features & NETIF_F_HW_VLAN_FILTER)
real_dev->vlan_rx_add_vid(real_dev, VLAN_ID); real_dev->vlan_rx_add_vid(real_dev, VLAN_ID);
@@ -755,8 +755,8 @@ static int vlan_ioctl_handler(void __user *arg)
/* TODO: Implement /* TODO: Implement
err = vlan_dev_get_ingress_priority(args); err = vlan_dev_get_ingress_priority(args);
if (copy_to_user((void*)arg, &args, if (copy_to_user((void*)arg, &args,
sizeof(struct vlan_ioctl_args))) { sizeof(struct vlan_ioctl_args))) {
err = -EFAULT; err = -EFAULT;
} }
*/ */
err = -EINVAL; err = -EINVAL;
@@ -765,8 +765,8 @@ static int vlan_ioctl_handler(void __user *arg)
/* TODO: Implement /* TODO: Implement
err = vlan_dev_get_egress_priority(args.device1, &(args.args); err = vlan_dev_get_egress_priority(args.device1, &(args.args);
if (copy_to_user((void*)arg, &args, if (copy_to_user((void*)arg, &args,
sizeof(struct vlan_ioctl_args))) { sizeof(struct vlan_ioctl_args))) {
err = -EFAULT; err = -EFAULT;
} }
*/ */
err = -EINVAL; err = -EINVAL;
@@ -788,7 +788,7 @@ static int vlan_ioctl_handler(void __user *arg)
args.u.VID = vid; args.u.VID = vid;
if (copy_to_user(arg, &args, if (copy_to_user(arg, &args,
sizeof(struct vlan_ioctl_args))) { sizeof(struct vlan_ioctl_args))) {
err = -EFAULT; err = -EFAULT;
} }
break; break;

View File

@@ -9,8 +9,8 @@
#define VLAN_ERR KERN_ERR #define VLAN_ERR KERN_ERR
#define VLAN_INF KERN_INFO #define VLAN_INF KERN_INFO
#define VLAN_DBG KERN_ALERT /* change these... to debug, having a hard time #define VLAN_DBG KERN_ALERT /* change these... to debug, having a hard time
* changing the log level at run-time..for some reason. * changing the log level at run-time..for some reason.
*/ */
/* /*
@@ -51,10 +51,10 @@ struct net_device *__find_vlan_dev(struct net_device* real_dev,
/* found in vlan_dev.c */ /* found in vlan_dev.c */
int vlan_dev_rebuild_header(struct sk_buff *skb); int vlan_dev_rebuild_header(struct sk_buff *skb);
int vlan_skb_recv(struct sk_buff *skb, struct net_device *dev, int vlan_skb_recv(struct sk_buff *skb, struct net_device *dev,
struct packet_type *ptype, struct net_device *orig_dev); struct packet_type *ptype, struct net_device *orig_dev);
int vlan_dev_hard_header(struct sk_buff *skb, struct net_device *dev, int vlan_dev_hard_header(struct sk_buff *skb, struct net_device *dev,
unsigned short type, void *daddr, void *saddr, unsigned short type, void *daddr, void *saddr,
unsigned len); unsigned len);
int vlan_dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev); int vlan_dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev);
int vlan_dev_hwaccel_hard_start_xmit(struct sk_buff *skb, struct net_device *dev); int vlan_dev_hwaccel_hard_start_xmit(struct sk_buff *skb, struct net_device *dev);
int vlan_dev_change_mtu(struct net_device *dev, int new_mtu); int vlan_dev_change_mtu(struct net_device *dev, int new_mtu);

View File

@@ -113,7 +113,7 @@ static inline struct sk_buff *vlan_check_reorder_header(struct sk_buff *skb)
* *
*/ */
int vlan_skb_recv(struct sk_buff *skb, struct net_device *dev, int vlan_skb_recv(struct sk_buff *skb, struct net_device *dev,
struct packet_type* ptype, struct net_device *orig_dev) struct packet_type* ptype, struct net_device *orig_dev)
{ {
unsigned char *rawp = NULL; unsigned char *rawp = NULL;
struct vlan_hdr *vhdr = (struct vlan_hdr *)(skb->data); struct vlan_hdr *vhdr = (struct vlan_hdr *)(skb->data);
@@ -328,8 +328,8 @@ static inline unsigned short vlan_dev_get_egress_qos_mask(struct net_device* dev
* physical devices. * physical devices.
*/ */
int vlan_dev_hard_header(struct sk_buff *skb, struct net_device *dev, int vlan_dev_hard_header(struct sk_buff *skb, struct net_device *dev,
unsigned short type, void *daddr, void *saddr, unsigned short type, void *daddr, void *saddr,
unsigned len) unsigned len)
{ {
struct vlan_hdr *vhdr; struct vlan_hdr *vhdr;
unsigned short veth_TCI = 0; unsigned short veth_TCI = 0;
@@ -700,7 +700,7 @@ int vlan_dev_set_mac_address(struct net_device *dev, void *addr_struct_p)
} }
static inline int vlan_dmi_equals(struct dev_mc_list *dmi1, static inline int vlan_dmi_equals(struct dev_mc_list *dmi1,
struct dev_mc_list *dmi2) struct dev_mc_list *dmi2)
{ {
return ((dmi1->dmi_addrlen == dmi2->dmi_addrlen) && return ((dmi1->dmi_addrlen == dmi2->dmi_addrlen) &&
(memcmp(dmi1->dmi_addr, dmi2->dmi_addr, dmi1->dmi_addrlen) == 0)); (memcmp(dmi1->dmi_addr, dmi2->dmi_addr, dmi1->dmi_addrlen) == 0));

View File

@@ -100,17 +100,17 @@ static struct sock *atalk_search_socket(struct sockaddr_at *to,
if (to->sat_port != at->src_port) if (to->sat_port != at->src_port)
continue; continue;
if (to->sat_addr.s_net == ATADDR_ANYNET && if (to->sat_addr.s_net == ATADDR_ANYNET &&
to->sat_addr.s_node == ATADDR_BCAST) to->sat_addr.s_node == ATADDR_BCAST)
goto found; goto found;
if (to->sat_addr.s_net == at->src_net && if (to->sat_addr.s_net == at->src_net &&
(to->sat_addr.s_node == at->src_node || (to->sat_addr.s_node == at->src_node ||
to->sat_addr.s_node == ATADDR_BCAST || to->sat_addr.s_node == ATADDR_BCAST ||
to->sat_addr.s_node == ATADDR_ANYNODE)) to->sat_addr.s_node == ATADDR_ANYNODE))
goto found; goto found;
/* XXXX.0 -- we got a request for this router. make sure /* XXXX.0 -- we got a request for this router. make sure
* that the node is appropriately set. */ * that the node is appropriately set. */
if (to->sat_addr.s_node == ATADDR_ANYNODE && if (to->sat_addr.s_node == ATADDR_ANYNODE &&
to->sat_addr.s_net != ATADDR_ANYNET && to->sat_addr.s_net != ATADDR_ANYNET &&
@@ -417,7 +417,7 @@ static struct atalk_iface *atalk_find_interface(__be16 net, int node)
if (node == ATADDR_ANYNODE && net != ATADDR_ANYNET && if (node == ATADDR_ANYNODE && net != ATADDR_ANYNET &&
ntohs(iface->nets.nr_firstnet) <= ntohs(net) && ntohs(iface->nets.nr_firstnet) <= ntohs(net) &&
ntohs(net) <= ntohs(iface->nets.nr_lastnet)) ntohs(net) <= ntohs(iface->nets.nr_lastnet))
break; break;
} }
read_unlock_bh(&atalk_interfaces_lock); read_unlock_bh(&atalk_interfaces_lock);
return iface; return iface;
@@ -540,9 +540,9 @@ static int atrtr_create(struct rtentry *r, struct net_device *devhint)
for (iface = atalk_interfaces; iface; iface = iface->next) { for (iface = atalk_interfaces; iface; iface = iface->next) {
if (!riface && if (!riface &&
ntohs(ga->sat_addr.s_net) >= ntohs(ga->sat_addr.s_net) >=
ntohs(iface->nets.nr_firstnet) && ntohs(iface->nets.nr_firstnet) &&
ntohs(ga->sat_addr.s_net) <= ntohs(ga->sat_addr.s_net) <=
ntohs(iface->nets.nr_lastnet)) ntohs(iface->nets.nr_lastnet))
riface = iface; riface = iface;
if (ga->sat_addr.s_net == iface->address.s_net && if (ga->sat_addr.s_net == iface->address.s_net &&
@@ -649,7 +649,7 @@ static int ddp_device_event(struct notifier_block *this, unsigned long event,
{ {
if (event == NETDEV_DOWN) if (event == NETDEV_DOWN)
/* Discard any use of this */ /* Discard any use of this */
atalk_dev_down(ptr); atalk_dev_down(ptr);
return NOTIFY_DONE; return NOTIFY_DONE;
} }
@@ -701,7 +701,7 @@ static int atif_ioctl(int cmd, void __user *arg)
*/ */
if ((dev->flags & IFF_POINTOPOINT) && if ((dev->flags & IFF_POINTOPOINT) &&
atalk_find_interface(sa->sat_addr.s_net, atalk_find_interface(sa->sat_addr.s_net,
sa->sat_addr.s_node)) { sa->sat_addr.s_node)) {
printk(KERN_DEBUG "AppleTalk: point-to-point " printk(KERN_DEBUG "AppleTalk: point-to-point "
"interface added with " "interface added with "
"existing address\n"); "existing address\n");
@@ -797,8 +797,8 @@ static int atif_ioctl(int cmd, void __user *arg)
sa->sat_addr.s_node = ATADDR_BCAST; sa->sat_addr.s_node = ATADDR_BCAST;
break; break;
case SIOCATALKDIFADDR: case SIOCATALKDIFADDR:
case SIOCDIFADDR: case SIOCDIFADDR:
if (!capable(CAP_NET_ADMIN)) if (!capable(CAP_NET_ADMIN))
return -EPERM; return -EPERM;
if (sa->sat_family != AF_APPLETALK) if (sa->sat_family != AF_APPLETALK)
@@ -808,67 +808,67 @@ static int atif_ioctl(int cmd, void __user *arg)
case SIOCSARP: case SIOCSARP:
if (!capable(CAP_NET_ADMIN)) if (!capable(CAP_NET_ADMIN))
return -EPERM; return -EPERM;
if (sa->sat_family != AF_APPLETALK) if (sa->sat_family != AF_APPLETALK)
return -EINVAL; return -EINVAL;
if (!atif) if (!atif)
return -EADDRNOTAVAIL; return -EADDRNOTAVAIL;
/* /*
* for now, we only support proxy AARP on ELAP; * for now, we only support proxy AARP on ELAP;
* we should be able to do it for LocalTalk, too. * we should be able to do it for LocalTalk, too.
*/ */
if (dev->type != ARPHRD_ETHER) if (dev->type != ARPHRD_ETHER)
return -EPROTONOSUPPORT; return -EPROTONOSUPPORT;
/* /*
* atif points to the current interface on this network; * atif points to the current interface on this network;
* we aren't concerned about its current status (at * we aren't concerned about its current status (at
* least for now), but it has all the settings about * least for now), but it has all the settings about
* the network we're going to probe. Consequently, it * the network we're going to probe. Consequently, it
* must exist. * must exist.
*/ */
if (!atif) if (!atif)
return -EADDRNOTAVAIL; return -EADDRNOTAVAIL;
nr = (struct atalk_netrange *)&(atif->nets); nr = (struct atalk_netrange *)&(atif->nets);
/* /*
* Phase 1 is fine on Localtalk but we don't do * Phase 1 is fine on Localtalk but we don't do
* Ethertalk phase 1. Anyone wanting to add it go ahead. * Ethertalk phase 1. Anyone wanting to add it go ahead.
*/ */
if (dev->type == ARPHRD_ETHER && nr->nr_phase != 2) if (dev->type == ARPHRD_ETHER && nr->nr_phase != 2)
return -EPROTONOSUPPORT; return -EPROTONOSUPPORT;
if (sa->sat_addr.s_node == ATADDR_BCAST || if (sa->sat_addr.s_node == ATADDR_BCAST ||
sa->sat_addr.s_node == 254) sa->sat_addr.s_node == 254)
return -EINVAL; return -EINVAL;
/*
* Check if the chosen address is used. If so we
* error and ATCP will try another.
*/
if (atif_proxy_probe_device(atif, &(sa->sat_addr)) < 0)
return -EADDRINUSE;
/* /*
* We now have an address on the local network, and * Check if the chosen address is used. If so we
* error and ATCP will try another.
*/
if (atif_proxy_probe_device(atif, &(sa->sat_addr)) < 0)
return -EADDRINUSE;
/*
* We now have an address on the local network, and
* the AARP code will defend it for us until we take it * the AARP code will defend it for us until we take it
* down. We don't set up any routes right now, because * down. We don't set up any routes right now, because
* ATCP will install them manually via SIOCADDRT. * ATCP will install them manually via SIOCADDRT.
*/ */
break; break;
case SIOCDARP: case SIOCDARP:
if (!capable(CAP_NET_ADMIN)) if (!capable(CAP_NET_ADMIN))
return -EPERM; return -EPERM;
if (sa->sat_family != AF_APPLETALK) if (sa->sat_family != AF_APPLETALK)
return -EINVAL; return -EINVAL;
if (!atif) if (!atif)
return -EADDRNOTAVAIL; return -EADDRNOTAVAIL;
/* give to aarp module to remove proxy entry */ /* give to aarp module to remove proxy entry */
aarp_proxy_remove(atif->dev, &(sa->sat_addr)); aarp_proxy_remove(atif->dev, &(sa->sat_addr));
return 0; return 0;
} }
return copy_to_user(arg, &atreq, sizeof(atreq)) ? -EFAULT : 0; return copy_to_user(arg, &atreq, sizeof(atreq)) ? -EFAULT : 0;
@@ -1260,27 +1260,27 @@ static int atalk_getname(struct socket *sock, struct sockaddr *uaddr,
#if defined(CONFIG_IPDDP) || defined(CONFIG_IPDDP_MODULE) #if defined(CONFIG_IPDDP) || defined(CONFIG_IPDDP_MODULE)
static __inline__ int is_ip_over_ddp(struct sk_buff *skb) static __inline__ int is_ip_over_ddp(struct sk_buff *skb)
{ {
return skb->data[12] == 22; return skb->data[12] == 22;
} }
static int handle_ip_over_ddp(struct sk_buff *skb) static int handle_ip_over_ddp(struct sk_buff *skb)
{ {
struct net_device *dev = __dev_get_by_name("ipddp0"); struct net_device *dev = __dev_get_by_name("ipddp0");
struct net_device_stats *stats; struct net_device_stats *stats;
/* This needs to be able to handle ipddp"N" devices */ /* This needs to be able to handle ipddp"N" devices */
if (!dev) if (!dev)
return -ENODEV; return -ENODEV;
skb->protocol = htons(ETH_P_IP); skb->protocol = htons(ETH_P_IP);
skb_pull(skb, 13); skb_pull(skb, 13);
skb->dev = dev; skb->dev = dev;
skb->h.raw = skb->data; skb->h.raw = skb->data;
stats = dev->priv; stats = dev->priv;
stats->rx_packets++; stats->rx_packets++;
stats->rx_bytes += skb->len + 13; stats->rx_bytes += skb->len + 13;
netif_rx(skb); /* Send the SKB up to a higher place. */ netif_rx(skb); /* Send the SKB up to a higher place. */
return 0; return 0;
} }
#else #else
@@ -1335,8 +1335,8 @@ static void atalk_route_packet(struct sk_buff *skb, struct net_device *dev,
ta.s_node = rt->gateway.s_node; ta.s_node = rt->gateway.s_node;
} }
/* Fix up skb->len field */ /* Fix up skb->len field */
skb_trim(skb, min_t(unsigned int, origlen, skb_trim(skb, min_t(unsigned int, origlen,
(rt->dev->hard_header_len + (rt->dev->hard_header_len +
ddp_dl->header_length + (len_hops & 1023)))); ddp_dl->header_length + (len_hops & 1023))));
@@ -1395,7 +1395,7 @@ static int atalk_rcv(struct sk_buff *skb, struct net_device *dev,
struct sock *sock; struct sock *sock;
struct atalk_iface *atif; struct atalk_iface *atif;
struct sockaddr_at tosat; struct sockaddr_at tosat;
int origlen; int origlen;
__u16 len_hops; __u16 len_hops;
/* Don't mangle buffer if shared */ /* Don't mangle buffer if shared */
@@ -1501,11 +1501,11 @@ static int ltalk_rcv(struct sk_buff *skb, struct net_device *dev,
/* Now fill in the long header */ /* Now fill in the long header */
/* /*
* These two first. The mac overlays the new source/dest * These two first. The mac overlays the new source/dest
* network information so we MUST copy these before * network information so we MUST copy these before
* we write the network numbers ! * we write the network numbers !
*/ */
ddp->deh_dnode = skb->mac.raw[0]; /* From physical header */ ddp->deh_dnode = skb->mac.raw[0]; /* From physical header */
ddp->deh_snode = skb->mac.raw[1]; /* From physical header */ ddp->deh_snode = skb->mac.raw[1]; /* From physical header */

View File

@@ -30,15 +30,15 @@ static ssize_t show_address(struct class_device *cdev, char *buf)
static ssize_t show_atmaddress(struct class_device *cdev, char *buf) static ssize_t show_atmaddress(struct class_device *cdev, char *buf)
{ {
unsigned long flags; unsigned long flags;
char *pos = buf; char *pos = buf;
struct atm_dev *adev = to_atm_dev(cdev); struct atm_dev *adev = to_atm_dev(cdev);
struct atm_dev_addr *aaddr; struct atm_dev_addr *aaddr;
int bin[] = { 1, 2, 10, 6, 1 }, *fmt = bin; int bin[] = { 1, 2, 10, 6, 1 }, *fmt = bin;
int i, j; int i, j;
spin_lock_irqsave(&adev->lock, flags); spin_lock_irqsave(&adev->lock, flags);
list_for_each_entry(aaddr, &adev->local, entry) { list_for_each_entry(aaddr, &adev->local, entry) {
for(i = 0, j = 0; i < ATM_ESA_LEN; ++i, ++j) { for(i = 0, j = 0; i < ATM_ESA_LEN; ++i, ++j) {
if (j == *fmt) { if (j == *fmt) {
pos += sprintf(pos, "."); pos += sprintf(pos, ".");
@@ -49,7 +49,7 @@ static ssize_t show_atmaddress(struct class_device *cdev, char *buf)
} }
pos += sprintf(pos, "\n"); pos += sprintf(pos, "\n");
} }
spin_unlock_irqrestore(&adev->lock, flags); spin_unlock_irqrestore(&adev->lock, flags);
return pos - buf; return pos - buf;
} }

View File

@@ -109,7 +109,7 @@ static inline int vcc_writable(struct sock *sk)
struct atm_vcc *vcc = atm_sk(sk); struct atm_vcc *vcc = atm_sk(sk);
return (vcc->qos.txtp.max_sdu + return (vcc->qos.txtp.max_sdu +
atomic_read(&sk->sk_wmem_alloc)) <= sk->sk_sndbuf; atomic_read(&sk->sk_wmem_alloc)) <= sk->sk_sndbuf;
} }
static void vcc_write_space(struct sock *sk) static void vcc_write_space(struct sock *sk)
@@ -500,14 +500,14 @@ int vcc_recvmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *msg,
msg->msg_flags |= MSG_TRUNC; msg->msg_flags |= MSG_TRUNC;
} }
error = skb_copy_datagram_iovec(skb, 0, msg->msg_iov, copied); error = skb_copy_datagram_iovec(skb, 0, msg->msg_iov, copied);
if (error) if (error)
return error; return error;
sock_recv_timestamp(msg, sk, skb); sock_recv_timestamp(msg, sk, skb);
DPRINTK("RcvM %d -= %d\n", atomic_read(&sk->rmem_alloc), skb->truesize); DPRINTK("RcvM %d -= %d\n", atomic_read(&sk->rmem_alloc), skb->truesize);
atm_return(vcc, skb->truesize); atm_return(vcc, skb->truesize);
skb_free_datagram(sk, skb); skb_free_datagram(sk, skb);
return copied; return copied;
} }
@@ -675,7 +675,7 @@ static int check_qos(struct atm_qos *qos)
int error; int error;
if (!qos->txtp.traffic_class && !qos->rxtp.traffic_class) if (!qos->txtp.traffic_class && !qos->rxtp.traffic_class)
return -EINVAL; return -EINVAL;
if (qos->txtp.traffic_class != qos->rxtp.traffic_class && if (qos->txtp.traffic_class != qos->rxtp.traffic_class &&
qos->txtp.traffic_class && qos->rxtp.traffic_class && qos->txtp.traffic_class && qos->rxtp.traffic_class &&
qos->txtp.traffic_class != ATM_ANYCLASS && qos->txtp.traffic_class != ATM_ANYCLASS &&
@@ -786,11 +786,11 @@ static int __init atm_init(void)
printk(KERN_ERR "atmsvc_init() failed with %d\n", error); printk(KERN_ERR "atmsvc_init() failed with %d\n", error);
goto out_atmpvc_exit; goto out_atmpvc_exit;
} }
if ((error = atm_proc_init()) < 0) { if ((error = atm_proc_init()) < 0) {
printk(KERN_ERR "atm_proc_init() failed with %d\n",error); printk(KERN_ERR "atm_proc_init() failed with %d\n",error);
goto out_atmsvc_exit; goto out_atmsvc_exit;
} }
if ((error = atm_sysfs_init()) < 0) { if ((error = atm_sysfs_init()) < 0) {
printk(KERN_ERR "atm_sysfs_init() failed with %d\n",error); printk(KERN_ERR "atm_sysfs_init() failed with %d\n",error);
goto out_atmproc_exit; goto out_atmproc_exit;
} }

View File

@@ -76,7 +76,7 @@ int vcc_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
} }
skb = skb_peek(&sk->sk_receive_queue); skb = skb_peek(&sk->sk_receive_queue);
error = put_user(skb ? skb->len : 0, error = put_user(skb ? skb->len : 0,
(int __user *)argp) ? -EFAULT : 0; (int __user *)argp) ? -EFAULT : 0;
goto done; goto done;
} }
case SIOCGSTAMP: /* borrowed from IP */ case SIOCGSTAMP: /* borrowed from IP */

View File

@@ -1473,9 +1473,9 @@ static void lec_arp_init(struct lec_priv *priv)
for (i = 0; i < LEC_ARP_TABLE_SIZE; i++) { for (i = 0; i < LEC_ARP_TABLE_SIZE; i++) {
INIT_HLIST_HEAD(&priv->lec_arp_tables[i]); INIT_HLIST_HEAD(&priv->lec_arp_tables[i]);
} }
INIT_HLIST_HEAD(&priv->lec_arp_empty_ones); INIT_HLIST_HEAD(&priv->lec_arp_empty_ones);
INIT_HLIST_HEAD(&priv->lec_no_forward); INIT_HLIST_HEAD(&priv->lec_no_forward);
INIT_HLIST_HEAD(&priv->mcast_fwds); INIT_HLIST_HEAD(&priv->mcast_fwds);
spin_lock_init(&priv->lec_arp_lock); spin_lock_init(&priv->lec_arp_lock);
INIT_DELAYED_WORK(&priv->lec_arp_work, lec_arp_check_expire); INIT_DELAYED_WORK(&priv->lec_arp_work, lec_arp_check_expire);
schedule_delayed_work(&priv->lec_arp_work, LEC_ARP_REFRESH_INTERVAL); schedule_delayed_work(&priv->lec_arp_work, LEC_ARP_REFRESH_INTERVAL);
@@ -2380,7 +2380,7 @@ lec_set_flush_tran_id(struct lec_priv *priv,
if (!memcmp(atm_addr, entry->atm_addr, ATM_ESA_LEN)) { if (!memcmp(atm_addr, entry->atm_addr, ATM_ESA_LEN)) {
entry->flush_tran_id = tran_id; entry->flush_tran_id = tran_id;
DPRINTK("Set flush transaction id to %lx for %p\n", DPRINTK("Set flush transaction id to %lx for %p\n",
tran_id, entry); tran_id, entry);
} }
} }
spin_unlock_irqrestore(&priv->lec_arp_lock, flags); spin_unlock_irqrestore(&priv->lec_arp_lock, flags);

View File

@@ -1079,7 +1079,7 @@ static void check_qos_and_open_shortcut(struct k_message *msg, struct mpoa_clien
else if(eg_entry->shortcut->qos.txtp.max_pcr > 0) else if(eg_entry->shortcut->qos.txtp.max_pcr > 0)
entry->shortcut = eg_entry->shortcut; entry->shortcut = eg_entry->shortcut;
} }
if(entry->shortcut){ if(entry->shortcut){
dprintk("mpoa: (%s) using egress SVC to reach %u.%u.%u.%u\n",client->dev->name, NIPQUAD(dst_ip)); dprintk("mpoa: (%s) using egress SVC to reach %u.%u.%u.%u\n",client->dev->name, NIPQUAD(dst_ip));
client->eg_ops->put(eg_entry); client->eg_ops->put(eg_entry);
return; return;
@@ -1094,7 +1094,7 @@ static void check_qos_and_open_shortcut(struct k_message *msg, struct mpoa_clien
{ {
msg->qos = qos->qos; msg->qos = qos->qos;
printk("mpoa: (%s) trying to get a CBR shortcut\n",client->dev->name); printk("mpoa: (%s) trying to get a CBR shortcut\n",client->dev->name);
} }
else memset(&msg->qos,0,sizeof(struct atm_qos)); else memset(&msg->qos,0,sizeof(struct atm_qos));
msg_to_mpoad(msg, client); msg_to_mpoad(msg, client);
return; return;

View File

@@ -12,32 +12,32 @@
int msg_to_mpoad(struct k_message *msg, struct mpoa_client *mpc); int msg_to_mpoad(struct k_message *msg, struct mpoa_client *mpc);
struct mpoa_client { struct mpoa_client {
struct mpoa_client *next; struct mpoa_client *next;
struct net_device *dev; /* lec in question */ struct net_device *dev; /* lec in question */
int dev_num; /* e.g. 2 for lec2 */ int dev_num; /* e.g. 2 for lec2 */
int (*old_hard_start_xmit)(struct sk_buff *skb, struct net_device *dev); int (*old_hard_start_xmit)(struct sk_buff *skb, struct net_device *dev);
struct atm_vcc *mpoad_vcc; /* control channel to mpoad */ struct atm_vcc *mpoad_vcc; /* control channel to mpoad */
uint8_t mps_ctrl_addr[ATM_ESA_LEN]; /* MPS control ATM address */ uint8_t mps_ctrl_addr[ATM_ESA_LEN]; /* MPS control ATM address */
uint8_t our_ctrl_addr[ATM_ESA_LEN]; /* MPC's control ATM address */ uint8_t our_ctrl_addr[ATM_ESA_LEN]; /* MPC's control ATM address */
rwlock_t ingress_lock; rwlock_t ingress_lock;
struct in_cache_ops *in_ops; /* ingress cache operations */ struct in_cache_ops *in_ops; /* ingress cache operations */
in_cache_entry *in_cache; /* the ingress cache of this MPC */ in_cache_entry *in_cache; /* the ingress cache of this MPC */
rwlock_t egress_lock; rwlock_t egress_lock;
struct eg_cache_ops *eg_ops; /* egress cache operations */ struct eg_cache_ops *eg_ops; /* egress cache operations */
eg_cache_entry *eg_cache; /* the egress cache of this MPC */ eg_cache_entry *eg_cache; /* the egress cache of this MPC */
uint8_t *mps_macs; /* array of MPS MAC addresses, >=1 */ uint8_t *mps_macs; /* array of MPS MAC addresses, >=1 */
int number_of_mps_macs; /* number of the above MAC addresses */ int number_of_mps_macs; /* number of the above MAC addresses */
struct mpc_parameters parameters; /* parameters for this client */ struct mpc_parameters parameters; /* parameters for this client */
}; };
struct atm_mpoa_qos { struct atm_mpoa_qos {
struct atm_mpoa_qos *next; struct atm_mpoa_qos *next;
__be32 ipaddr; __be32 ipaddr;
struct atm_qos qos; struct atm_qos qos;
}; };

View File

@@ -369,7 +369,7 @@ static eg_cache_entry *eg_cache_get_by_vcc(struct atm_vcc *vcc, struct mpoa_clie
while (entry != NULL){ while (entry != NULL){
if (entry->shortcut == vcc) { if (entry->shortcut == vcc) {
atomic_inc(&entry->use); atomic_inc(&entry->use);
read_unlock_irqrestore(&mpc->egress_lock, flags); read_unlock_irqrestore(&mpc->egress_lock, flags);
return entry; return entry;
} }
entry = entry->next; entry = entry->next;
@@ -388,7 +388,7 @@ static eg_cache_entry *eg_cache_get_by_src_ip(__be32 ipaddr, struct mpoa_client
while(entry != NULL){ while(entry != NULL){
if(entry->latest_ip_addr == ipaddr) { if(entry->latest_ip_addr == ipaddr) {
atomic_inc(&entry->use); atomic_inc(&entry->use);
read_unlock_irq(&mpc->egress_lock); read_unlock_irq(&mpc->egress_lock);
return entry; return entry;
} }
entry = entry->next; entry = entry->next;

View File

@@ -12,66 +12,66 @@ struct mpoa_client;
void atm_mpoa_init_cache(struct mpoa_client *mpc); void atm_mpoa_init_cache(struct mpoa_client *mpc);
typedef struct in_cache_entry { typedef struct in_cache_entry {
struct in_cache_entry *next; struct in_cache_entry *next;
struct in_cache_entry *prev; struct in_cache_entry *prev;
struct timeval tv; struct timeval tv;
struct timeval reply_wait; struct timeval reply_wait;
struct timeval hold_down; struct timeval hold_down;
uint32_t packets_fwded; uint32_t packets_fwded;
uint16_t entry_state; uint16_t entry_state;
uint32_t retry_time; uint32_t retry_time;
uint32_t refresh_time; uint32_t refresh_time;
uint32_t count; uint32_t count;
struct atm_vcc *shortcut; struct atm_vcc *shortcut;
uint8_t MPS_ctrl_ATM_addr[ATM_ESA_LEN]; uint8_t MPS_ctrl_ATM_addr[ATM_ESA_LEN];
struct in_ctrl_info ctrl_info; struct in_ctrl_info ctrl_info;
atomic_t use; atomic_t use;
} in_cache_entry; } in_cache_entry;
struct in_cache_ops{ struct in_cache_ops{
in_cache_entry *(*add_entry)(__be32 dst_ip, in_cache_entry *(*add_entry)(__be32 dst_ip,
struct mpoa_client *client); struct mpoa_client *client);
in_cache_entry *(*get)(__be32 dst_ip, struct mpoa_client *client); in_cache_entry *(*get)(__be32 dst_ip, struct mpoa_client *client);
in_cache_entry *(*get_with_mask)(__be32 dst_ip, in_cache_entry *(*get_with_mask)(__be32 dst_ip,
struct mpoa_client *client, struct mpoa_client *client,
__be32 mask); __be32 mask);
in_cache_entry *(*get_by_vcc)(struct atm_vcc *vcc, in_cache_entry *(*get_by_vcc)(struct atm_vcc *vcc,
struct mpoa_client *client); struct mpoa_client *client);
void (*put)(in_cache_entry *entry); void (*put)(in_cache_entry *entry);
void (*remove_entry)(in_cache_entry *delEntry, void (*remove_entry)(in_cache_entry *delEntry,
struct mpoa_client *client ); struct mpoa_client *client );
int (*cache_hit)(in_cache_entry *entry, int (*cache_hit)(in_cache_entry *entry,
struct mpoa_client *client); struct mpoa_client *client);
void (*clear_count)(struct mpoa_client *client); void (*clear_count)(struct mpoa_client *client);
void (*check_resolving)(struct mpoa_client *client); void (*check_resolving)(struct mpoa_client *client);
void (*refresh)(struct mpoa_client *client); void (*refresh)(struct mpoa_client *client);
void (*destroy_cache)(struct mpoa_client *mpc); void (*destroy_cache)(struct mpoa_client *mpc);
}; };
typedef struct eg_cache_entry{ typedef struct eg_cache_entry{
struct eg_cache_entry *next; struct eg_cache_entry *next;
struct eg_cache_entry *prev; struct eg_cache_entry *prev;
struct timeval tv; struct timeval tv;
uint8_t MPS_ctrl_ATM_addr[ATM_ESA_LEN]; uint8_t MPS_ctrl_ATM_addr[ATM_ESA_LEN];
struct atm_vcc *shortcut; struct atm_vcc *shortcut;
uint32_t packets_rcvd; uint32_t packets_rcvd;
uint16_t entry_state; uint16_t entry_state;
__be32 latest_ip_addr; /* The src IP address of the last packet */ __be32 latest_ip_addr; /* The src IP address of the last packet */
struct eg_ctrl_info ctrl_info; struct eg_ctrl_info ctrl_info;
atomic_t use; atomic_t use;
} eg_cache_entry; } eg_cache_entry;
struct eg_cache_ops{ struct eg_cache_ops{
eg_cache_entry *(*add_entry)(struct k_message *msg, struct mpoa_client *client); eg_cache_entry *(*add_entry)(struct k_message *msg, struct mpoa_client *client);
eg_cache_entry *(*get_by_cache_id)(__be32 cache_id, struct mpoa_client *client); eg_cache_entry *(*get_by_cache_id)(__be32 cache_id, struct mpoa_client *client);
eg_cache_entry *(*get_by_tag)(__be32 cache_id, struct mpoa_client *client); eg_cache_entry *(*get_by_tag)(__be32 cache_id, struct mpoa_client *client);
eg_cache_entry *(*get_by_vcc)(struct atm_vcc *vcc, struct mpoa_client *client); eg_cache_entry *(*get_by_vcc)(struct atm_vcc *vcc, struct mpoa_client *client);
eg_cache_entry *(*get_by_src_ip)(__be32 ipaddr, struct mpoa_client *client); eg_cache_entry *(*get_by_src_ip)(__be32 ipaddr, struct mpoa_client *client);
void (*put)(eg_cache_entry *entry); void (*put)(eg_cache_entry *entry);
void (*remove_entry)(eg_cache_entry *entry, struct mpoa_client *client); void (*remove_entry)(eg_cache_entry *entry, struct mpoa_client *client);
void (*update)(eg_cache_entry *entry, uint16_t holding_time); void (*update)(eg_cache_entry *entry, uint16_t holding_time);
void (*clear_expired)(struct mpoa_client *client); void (*clear_expired)(struct mpoa_client *client);
void (*destroy_cache)(struct mpoa_client *mpc); void (*destroy_cache)(struct mpoa_client *mpc);
}; };

View File

@@ -32,7 +32,7 @@ extern struct proc_dir_entry *atm_proc_root; /* from proc.c. */
static int proc_mpc_open(struct inode *inode, struct file *file); static int proc_mpc_open(struct inode *inode, struct file *file);
static ssize_t proc_mpc_write(struct file *file, const char __user *buff, static ssize_t proc_mpc_write(struct file *file, const char __user *buff,
size_t nbytes, loff_t *ppos); size_t nbytes, loff_t *ppos);
static int parse_qos(const char *buff); static int parse_qos(const char *buff);
@@ -52,18 +52,18 @@ static struct file_operations mpc_file_operations = {
* Returns the state of an ingress cache entry as a string * Returns the state of an ingress cache entry as a string
*/ */
static const char *ingress_state_string(int state){ static const char *ingress_state_string(int state){
switch(state) { switch(state) {
case INGRESS_RESOLVING: case INGRESS_RESOLVING:
return "resolving "; return "resolving ";
break; break;
case INGRESS_RESOLVED: case INGRESS_RESOLVED:
return "resolved "; return "resolved ";
break; break;
case INGRESS_INVALID: case INGRESS_INVALID:
return "invalid "; return "invalid ";
break; break;
case INGRESS_REFRESHING: case INGRESS_REFRESHING:
return "refreshing "; return "refreshing ";
break; break;
default: default:
return ""; return "";
@@ -74,15 +74,15 @@ static const char *ingress_state_string(int state){
* Returns the state of an egress cache entry as a string * Returns the state of an egress cache entry as a string
*/ */
static const char *egress_state_string(int state){ static const char *egress_state_string(int state){
switch(state) { switch(state) {
case EGRESS_RESOLVED: case EGRESS_RESOLVED:
return "resolved "; return "resolved ";
break; break;
case EGRESS_PURGE: case EGRESS_PURGE:
return "purge "; return "purge ";
break; break;
case EGRESS_INVALID: case EGRESS_INVALID:
return "invalid "; return "invalid ";
break; break;
default: default:
return ""; return "";
@@ -190,51 +190,51 @@ static int proc_mpc_open(struct inode *inode, struct file *file)
} }
static ssize_t proc_mpc_write(struct file *file, const char __user *buff, static ssize_t proc_mpc_write(struct file *file, const char __user *buff,
size_t nbytes, loff_t *ppos) size_t nbytes, loff_t *ppos)
{ {
char *page, *p; char *page, *p;
unsigned len; unsigned len;
if (nbytes == 0) if (nbytes == 0)
return 0; return 0;
if (nbytes >= PAGE_SIZE) if (nbytes >= PAGE_SIZE)
nbytes = PAGE_SIZE-1; nbytes = PAGE_SIZE-1;
page = (char *)__get_free_page(GFP_KERNEL); page = (char *)__get_free_page(GFP_KERNEL);
if (!page) if (!page)
return -ENOMEM; return -ENOMEM;
for (p = page, len = 0; len < nbytes; p++, len++) { for (p = page, len = 0; len < nbytes; p++, len++) {
if (get_user(*p, buff++)) { if (get_user(*p, buff++)) {
free_page((unsigned long)page); free_page((unsigned long)page);
return -EFAULT; return -EFAULT;
} }
if (*p == '\0' || *p == '\n') if (*p == '\0' || *p == '\n')
break; break;
} }
*p = '\0'; *p = '\0';
if (!parse_qos(page)) if (!parse_qos(page))
printk("mpoa: proc_mpc_write: could not parse '%s'\n", page); printk("mpoa: proc_mpc_write: could not parse '%s'\n", page);
free_page((unsigned long)page); free_page((unsigned long)page);
return len; return len;
} }
static int parse_qos(const char *buff) static int parse_qos(const char *buff)
{ {
/* possible lines look like this /* possible lines look like this
* add 130.230.54.142 tx=max_pcr,max_sdu rx=max_pcr,max_sdu * add 130.230.54.142 tx=max_pcr,max_sdu rx=max_pcr,max_sdu
*/ */
unsigned char ip[4]; unsigned char ip[4];
int tx_pcr, tx_sdu, rx_pcr, rx_sdu; int tx_pcr, tx_sdu, rx_pcr, rx_sdu;
__be32 ipaddr; __be32 ipaddr;
struct atm_qos qos; struct atm_qos qos;
memset(&qos, 0, sizeof(struct atm_qos)); memset(&qos, 0, sizeof(struct atm_qos));
if (sscanf(buff, "del %hhu.%hhu.%hhu.%hhu", if (sscanf(buff, "del %hhu.%hhu.%hhu.%hhu",
ip, ip+1, ip+2, ip+3) == 4) { ip, ip+1, ip+2, ip+3) == 4) {
@@ -250,14 +250,14 @@ static int parse_qos(const char *buff)
ip, ip+1, ip+2, ip+3, &tx_pcr, &tx_sdu, &rx_pcr, &rx_sdu) != 8) ip, ip+1, ip+2, ip+3, &tx_pcr, &tx_sdu, &rx_pcr, &rx_sdu) != 8)
return 0; return 0;
ipaddr = *(__be32 *)ip; ipaddr = *(__be32 *)ip;
qos.txtp.traffic_class = ATM_CBR; qos.txtp.traffic_class = ATM_CBR;
qos.txtp.max_pcr = tx_pcr; qos.txtp.max_pcr = tx_pcr;
qos.txtp.max_sdu = tx_sdu; qos.txtp.max_sdu = tx_sdu;
qos.rxtp.traffic_class = ATM_CBR; qos.rxtp.traffic_class = ATM_CBR;
qos.rxtp.max_pcr = rx_pcr; qos.rxtp.max_pcr = rx_pcr;
qos.rxtp.max_sdu = rx_sdu; qos.rxtp.max_sdu = rx_sdu;
qos.aal = ATM_AAL5; qos.aal = ATM_AAL5;
dprintk("mpoa: mpoa_proc.c: parse_qos(): setting qos paramameters to tx=%d,%d rx=%d,%d\n", dprintk("mpoa: mpoa_proc.c: parse_qos(): setting qos paramameters to tx=%d,%d rx=%d,%d\n",
qos.txtp.max_pcr, qos.txtp.max_pcr,
qos.txtp.max_sdu, qos.txtp.max_sdu,
@@ -276,11 +276,11 @@ int mpc_proc_init(void)
{ {
struct proc_dir_entry *p; struct proc_dir_entry *p;
p = create_proc_entry(STAT_FILE_NAME, 0, atm_proc_root); p = create_proc_entry(STAT_FILE_NAME, 0, atm_proc_root);
if (!p) { if (!p) {
printk(KERN_ERR "Unable to initialize /proc/atm/%s\n", STAT_FILE_NAME); printk(KERN_ERR "Unable to initialize /proc/atm/%s\n", STAT_FILE_NAME);
return -ENOMEM; return -ENOMEM;
} }
p->proc_fops = &mpc_file_operations; p->proc_fops = &mpc_file_operations;
p->owner = THIS_MODULE; p->owner = THIS_MODULE;
return 0; return 0;

View File

@@ -257,7 +257,7 @@ static int atm_dev_seq_show(struct seq_file *seq, void *v)
atm_dev_info(seq, dev); atm_dev_info(seq, dev);
} }
return 0; return 0;
} }
static struct seq_operations atm_dev_seq_ops = { static struct seq_operations atm_dev_seq_ops = {
@@ -316,29 +316,29 @@ static struct file_operations pvc_seq_fops = {
static int vcc_seq_show(struct seq_file *seq, void *v) static int vcc_seq_show(struct seq_file *seq, void *v)
{ {
if (v == (void *)1) { if (v == (void *)1) {
seq_printf(seq, sizeof(void *) == 4 ? "%-8s%s" : "%-16s%s", seq_printf(seq, sizeof(void *) == 4 ? "%-8s%s" : "%-16s%s",
"Address ", "Itf VPI VCI Fam Flags Reply " "Address ", "Itf VPI VCI Fam Flags Reply "
"Send buffer Recv buffer [refcnt]\n"); "Send buffer Recv buffer [refcnt]\n");
} else { } else {
struct vcc_state *state = seq->private; struct vcc_state *state = seq->private;
struct atm_vcc *vcc = atm_sk(state->sk); struct atm_vcc *vcc = atm_sk(state->sk);
vcc_info(seq, vcc); vcc_info(seq, vcc);
} }
return 0; return 0;
} }
static struct seq_operations vcc_seq_ops = { static struct seq_operations vcc_seq_ops = {
.start = vcc_seq_start, .start = vcc_seq_start,
.next = vcc_seq_next, .next = vcc_seq_next,
.stop = vcc_seq_stop, .stop = vcc_seq_stop,
.show = vcc_seq_show, .show = vcc_seq_show,
}; };
static int vcc_seq_open(struct inode *inode, struct file *file) static int vcc_seq_open(struct inode *inode, struct file *file)
{ {
return __vcc_seq_open(inode, file, 0, &vcc_seq_ops); return __vcc_seq_open(inode, file, 0, &vcc_seq_ops);
} }
static struct file_operations vcc_seq_fops = { static struct file_operations vcc_seq_fops = {

View File

@@ -72,7 +72,7 @@ static int pvc_setsockopt(struct socket *sock, int level, int optname,
static int pvc_getsockopt(struct socket *sock, int level, int optname, static int pvc_getsockopt(struct socket *sock, int level, int optname,
char __user *optval, int __user *optlen) char __user *optval, int __user *optlen)
{ {
struct sock *sk = sock->sk; struct sock *sk = sock->sk;
int error; int error;
@@ -91,7 +91,7 @@ static int pvc_getname(struct socket *sock,struct sockaddr *sockaddr,
struct atm_vcc *vcc = ATM_SD(sock); struct atm_vcc *vcc = ATM_SD(sock);
if (!vcc->dev || !test_bit(ATM_VF_ADDR,&vcc->flags)) return -ENOTCONN; if (!vcc->dev || !test_bit(ATM_VF_ADDR,&vcc->flags)) return -ENOTCONN;
*sockaddr_len = sizeof(struct sockaddr_atmpvc); *sockaddr_len = sizeof(struct sockaddr_atmpvc);
addr = (struct sockaddr_atmpvc *) sockaddr; addr = (struct sockaddr_atmpvc *) sockaddr;
addr->sap_family = AF_ATMPVC; addr->sap_family = AF_ATMPVC;
addr->sap_addr.itf = vcc->dev->number; addr->sap_addr.itf = vcc->dev->number;

View File

@@ -56,12 +56,12 @@ static int atm_send_aal0(struct atm_vcc *vcc,struct sk_buff *skb)
* still work * still work
*/ */
if (!capable(CAP_NET_ADMIN) && if (!capable(CAP_NET_ADMIN) &&
(((u32 *) skb->data)[0] & (ATM_HDR_VPI_MASK | ATM_HDR_VCI_MASK)) != (((u32 *) skb->data)[0] & (ATM_HDR_VPI_MASK | ATM_HDR_VCI_MASK)) !=
((vcc->vpi << ATM_HDR_VPI_SHIFT) | (vcc->vci << ATM_HDR_VCI_SHIFT))) ((vcc->vpi << ATM_HDR_VPI_SHIFT) | (vcc->vci << ATM_HDR_VCI_SHIFT)))
{ {
kfree_skb(skb); kfree_skb(skb);
return -EADDRNOTAVAIL; return -EADDRNOTAVAIL;
} }
return vcc->dev->ops->send(vcc,skb); return vcc->dev->ops->send(vcc,skb);
} }

View File

@@ -228,7 +228,7 @@ int atm_dev_ioctl(unsigned int cmd, void __user *arg)
*tmp_p++ = dev->number; *tmp_p++ = dev->number;
} }
mutex_unlock(&atm_dev_mutex); mutex_unlock(&atm_dev_mutex);
error = ((copy_to_user(buf, tmp_buf, size)) || error = ((copy_to_user(buf, tmp_buf, size)) ||
put_user(size, &iobuf->length)) put_user(size, &iobuf->length))
? -EFAULT : 0; ? -EFAULT : 0;
kfree(tmp_buf); kfree(tmp_buf);
@@ -414,13 +414,13 @@ static __inline__ void *dev_get_idx(loff_t left)
void *atm_dev_seq_start(struct seq_file *seq, loff_t *pos) void *atm_dev_seq_start(struct seq_file *seq, loff_t *pos)
{ {
mutex_lock(&atm_dev_mutex); mutex_lock(&atm_dev_mutex);
return *pos ? dev_get_idx(*pos) : (void *) 1; return *pos ? dev_get_idx(*pos) : (void *) 1;
} }
void atm_dev_seq_stop(struct seq_file *seq, void *v) void atm_dev_seq_stop(struct seq_file *seq, void *v)
{ {
mutex_unlock(&atm_dev_mutex); mutex_unlock(&atm_dev_mutex);
} }
void *atm_dev_seq_next(struct seq_file *seq, void *v, loff_t *pos) void *atm_dev_seq_next(struct seq_file *seq, void *v, loff_t *pos)

View File

@@ -89,7 +89,7 @@ static int svc_release(struct socket *sock)
clear_bit(ATM_VF_READY, &vcc->flags); clear_bit(ATM_VF_READY, &vcc->flags);
/* VCC pointer is used as a reference, so we must not free it /* VCC pointer is used as a reference, so we must not free it
(thereby subjecting it to re-use) before all pending connections (thereby subjecting it to re-use) before all pending connections
are closed */ are closed */
svc_disconnect(vcc); svc_disconnect(vcc);
vcc_release(sock); vcc_release(sock);
} }
@@ -144,7 +144,7 @@ static int svc_bind(struct socket *sock,struct sockaddr *sockaddr,
error = -EUNATCH; error = -EUNATCH;
goto out; goto out;
} }
if (!sk->sk_err) if (!sk->sk_err)
set_bit(ATM_VF_BOUND,&vcc->flags); set_bit(ATM_VF_BOUND,&vcc->flags);
error = -sk->sk_err; error = -sk->sk_err;
out: out:
@@ -229,7 +229,7 @@ static int svc_connect(struct socket *sock,struct sockaddr *sockaddr,
* This is tricky: * This is tricky:
* Kernel ---close--> Demon * Kernel ---close--> Demon
* Kernel <--close--- Demon * Kernel <--close--- Demon
* or * or
* Kernel ---close--> Demon * Kernel ---close--> Demon
* Kernel <--error--- Demon * Kernel <--error--- Demon
* or * or
@@ -470,13 +470,13 @@ static int svc_setsockopt(struct socket *sock, int level, int optname,
} }
set_bit(ATM_VF_HASSAP, &vcc->flags); set_bit(ATM_VF_HASSAP, &vcc->flags);
break; break;
case SO_MULTIPOINT: case SO_MULTIPOINT:
if (level != SOL_ATM || optlen != sizeof(int)) { if (level != SOL_ATM || optlen != sizeof(int)) {
error = -EINVAL; error = -EINVAL;
goto out; goto out;
} }
if (get_user(value, (int __user *) optval)) { if (get_user(value, (int __user *) optval)) {
error = -EFAULT; error = -EFAULT;
goto out; goto out;
} }
if (value == 1) { if (value == 1) {
@@ -486,7 +486,7 @@ static int svc_setsockopt(struct socket *sock, int level, int optname,
} else { } else {
error = -EINVAL; error = -EINVAL;
} }
break; break;
default: default:
error = vcc_setsockopt(sock, level, optname, error = vcc_setsockopt(sock, level, optname,
optval, optlen); optval, optlen);
@@ -539,7 +539,7 @@ static int svc_addparty(struct socket *sock, struct sockaddr *sockaddr,
set_bit(ATM_VF_WAITING, &vcc->flags); set_bit(ATM_VF_WAITING, &vcc->flags);
prepare_to_wait(sk->sk_sleep, &wait, TASK_INTERRUPTIBLE); prepare_to_wait(sk->sk_sleep, &wait, TASK_INTERRUPTIBLE);
sigd_enq(vcc, as_addparty, NULL, NULL, sigd_enq(vcc, as_addparty, NULL, NULL,
(struct sockaddr_atmsvc *) sockaddr); (struct sockaddr_atmsvc *) sockaddr);
if (flags & O_NONBLOCK) { if (flags & O_NONBLOCK) {
finish_wait(sk->sk_sleep, &wait); finish_wait(sk->sk_sleep, &wait);
error = -EINPROGRESS; error = -EINPROGRESS;
@@ -587,26 +587,26 @@ out:
static int svc_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) static int svc_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
{ {
int error, ep_ref; int error, ep_ref;
struct sockaddr_atmsvc sa; struct sockaddr_atmsvc sa;
struct atm_vcc *vcc = ATM_SD(sock); struct atm_vcc *vcc = ATM_SD(sock);
switch (cmd) { switch (cmd) {
case ATM_ADDPARTY: case ATM_ADDPARTY:
if (!test_bit(ATM_VF_SESSION, &vcc->flags)) if (!test_bit(ATM_VF_SESSION, &vcc->flags))
return -EINVAL; return -EINVAL;
if (copy_from_user(&sa, (void __user *) arg, sizeof(sa))) if (copy_from_user(&sa, (void __user *) arg, sizeof(sa)))
return -EFAULT; return -EFAULT;
error = svc_addparty(sock, (struct sockaddr *) &sa, sizeof(sa), 0); error = svc_addparty(sock, (struct sockaddr *) &sa, sizeof(sa), 0);
break; break;
case ATM_DROPPARTY: case ATM_DROPPARTY:
if (!test_bit(ATM_VF_SESSION, &vcc->flags)) if (!test_bit(ATM_VF_SESSION, &vcc->flags))
return -EINVAL; return -EINVAL;
if (copy_from_user(&ep_ref, (void __user *) arg, sizeof(int))) if (copy_from_user(&ep_ref, (void __user *) arg, sizeof(int)))
return -EFAULT; return -EFAULT;
error = svc_dropparty(sock, ep_ref); error = svc_dropparty(sock, ep_ref);
break; break;
default: default:
error = vcc_ioctl(sock, cmd, arg); error = vcc_ioctl(sock, cmd, arg);
} }

View File

@@ -369,57 +369,57 @@ static int ax25_ctl_ioctl(const unsigned int cmd, void __user *arg)
ax25_disconnect(ax25, ENETRESET); ax25_disconnect(ax25, ENETRESET);
break; break;
case AX25_WINDOW: case AX25_WINDOW:
if (ax25->modulus == AX25_MODULUS) { if (ax25->modulus == AX25_MODULUS) {
if (ax25_ctl.arg < 1 || ax25_ctl.arg > 7) if (ax25_ctl.arg < 1 || ax25_ctl.arg > 7)
return -EINVAL; return -EINVAL;
} else { } else {
if (ax25_ctl.arg < 1 || ax25_ctl.arg > 63) if (ax25_ctl.arg < 1 || ax25_ctl.arg > 63)
return -EINVAL; return -EINVAL;
} }
ax25->window = ax25_ctl.arg; ax25->window = ax25_ctl.arg;
break; break;
case AX25_T1: case AX25_T1:
if (ax25_ctl.arg < 1) if (ax25_ctl.arg < 1)
return -EINVAL;
ax25->rtt = (ax25_ctl.arg * HZ) / 2;
ax25->t1 = ax25_ctl.arg * HZ;
break;
case AX25_T2:
if (ax25_ctl.arg < 1)
return -EINVAL;
ax25->t2 = ax25_ctl.arg * HZ;
break;
case AX25_N2:
if (ax25_ctl.arg < 1 || ax25_ctl.arg > 31)
return -EINVAL; return -EINVAL;
ax25->n2count = 0; ax25->rtt = (ax25_ctl.arg * HZ) / 2;
ax25->n2 = ax25_ctl.arg; ax25->t1 = ax25_ctl.arg * HZ;
break; break;
case AX25_T3: case AX25_T2:
if (ax25_ctl.arg < 0) if (ax25_ctl.arg < 1)
return -EINVAL; return -EINVAL;
ax25->t3 = ax25_ctl.arg * HZ; ax25->t2 = ax25_ctl.arg * HZ;
break; break;
case AX25_IDLE: case AX25_N2:
if (ax25_ctl.arg < 0) if (ax25_ctl.arg < 1 || ax25_ctl.arg > 31)
return -EINVAL; return -EINVAL;
ax25->idle = ax25_ctl.arg * 60 * HZ; ax25->n2count = 0;
break; ax25->n2 = ax25_ctl.arg;
break;
case AX25_PACLEN: case AX25_T3:
if (ax25_ctl.arg < 16 || ax25_ctl.arg > 65535) if (ax25_ctl.arg < 0)
return -EINVAL; return -EINVAL;
ax25->paclen = ax25_ctl.arg; ax25->t3 = ax25_ctl.arg * HZ;
break; break;
default: case AX25_IDLE:
return -EINVAL; if (ax25_ctl.arg < 0)
return -EINVAL;
ax25->idle = ax25_ctl.arg * 60 * HZ;
break;
case AX25_PACLEN:
if (ax25_ctl.arg < 16 || ax25_ctl.arg > 65535)
return -EINVAL;
ax25->paclen = ax25_ctl.arg;
break;
default:
return -EINVAL;
} }
return 0; return 0;
@@ -1209,7 +1209,7 @@ static int __must_check ax25_connect(struct socket *sock,
if (sk->sk_type == SOCK_SEQPACKET && if (sk->sk_type == SOCK_SEQPACKET &&
(ax25t=ax25_find_cb(&ax25->source_addr, &fsa->fsa_ax25.sax25_call, digi, (ax25t=ax25_find_cb(&ax25->source_addr, &fsa->fsa_ax25.sax25_call, digi,
ax25->ax25_dev->dev))) { ax25->ax25_dev->dev))) {
kfree(digi); kfree(digi);
err = -EADDRINUSE; /* Already such a connection */ err = -EADDRINUSE; /* Already such a connection */
ax25_cb_put(ax25t); ax25_cb_put(ax25t);
@@ -1470,8 +1470,8 @@ static int ax25_sendmsg(struct kiocb *iocb, struct socket *sock,
else if (addr_len != sizeof(struct full_sockaddr_ax25)) { else if (addr_len != sizeof(struct full_sockaddr_ax25)) {
/* support for old structure may go away some time */ /* support for old structure may go away some time */
if ((addr_len < sizeof(struct sockaddr_ax25) + sizeof(ax25_address) * 6) || if ((addr_len < sizeof(struct sockaddr_ax25) + sizeof(ax25_address) * 6) ||
(addr_len > sizeof(struct full_sockaddr_ax25))) { (addr_len > sizeof(struct full_sockaddr_ax25))) {
err = -EINVAL; err = -EINVAL;
goto out; goto out;
} }
@@ -1624,7 +1624,7 @@ static int ax25_recvmsg(struct kiocb *iocb, struct socket *sock,
/* Now we can treat all alike */ /* Now we can treat all alike */
skb = skb_recv_datagram(sk, flags & ~MSG_DONTWAIT, skb = skb_recv_datagram(sk, flags & ~MSG_DONTWAIT,
flags & MSG_DONTWAIT, &err); flags & MSG_DONTWAIT, &err);
if (skb == NULL) if (skb == NULL)
goto out; goto out;

View File

@@ -126,10 +126,10 @@ int ax25cmp(const ax25_address *a, const ax25_address *b)
ct++; ct++;
} }
if ((a->ax25_call[ct] & 0x1E) == (b->ax25_call[ct] & 0x1E)) /* SSID without control bit */ if ((a->ax25_call[ct] & 0x1E) == (b->ax25_call[ct] & 0x1E)) /* SSID without control bit */
return 0; return 0;
return 2; /* Partial match */ return 2; /* Partial match */
} }
EXPORT_SYMBOL(ax25cmp); EXPORT_SYMBOL(ax25cmp);

View File

@@ -55,46 +55,46 @@ int ax25_hard_header(struct sk_buff *skb, struct net_device *dev, unsigned short
if (type == ETH_P_AX25) if (type == ETH_P_AX25)
return 0; return 0;
/* header is an AX.25 UI frame from us to them */ /* header is an AX.25 UI frame from us to them */
buff = skb_push(skb, AX25_HEADER_LEN); buff = skb_push(skb, AX25_HEADER_LEN);
*buff++ = 0x00; /* KISS DATA */ *buff++ = 0x00; /* KISS DATA */
if (daddr != NULL) if (daddr != NULL)
memcpy(buff, daddr, dev->addr_len); /* Address specified */ memcpy(buff, daddr, dev->addr_len); /* Address specified */
buff[6] &= ~AX25_CBIT; buff[6] &= ~AX25_CBIT;
buff[6] &= ~AX25_EBIT; buff[6] &= ~AX25_EBIT;
buff[6] |= AX25_SSSID_SPARE; buff[6] |= AX25_SSSID_SPARE;
buff += AX25_ADDR_LEN; buff += AX25_ADDR_LEN;
if (saddr != NULL) if (saddr != NULL)
memcpy(buff, saddr, dev->addr_len); memcpy(buff, saddr, dev->addr_len);
else else
memcpy(buff, dev->dev_addr, dev->addr_len); memcpy(buff, dev->dev_addr, dev->addr_len);
buff[6] &= ~AX25_CBIT; buff[6] &= ~AX25_CBIT;
buff[6] |= AX25_EBIT; buff[6] |= AX25_EBIT;
buff[6] |= AX25_SSSID_SPARE; buff[6] |= AX25_SSSID_SPARE;
buff += AX25_ADDR_LEN; buff += AX25_ADDR_LEN;
*buff++ = AX25_UI; /* UI */ *buff++ = AX25_UI; /* UI */
/* Append a suitable AX.25 PID */ /* Append a suitable AX.25 PID */
switch (type) { switch (type) {
case ETH_P_IP: case ETH_P_IP:
*buff++ = AX25_P_IP; *buff++ = AX25_P_IP;
break; break;
case ETH_P_ARP: case ETH_P_ARP:
*buff++ = AX25_P_ARP; *buff++ = AX25_P_ARP;
break; break;
default: default:
printk(KERN_ERR "AX.25: ax25_hard_header - wrong protocol type 0x%2.2x\n", type); printk(KERN_ERR "AX.25: ax25_hard_header - wrong protocol type 0x%2.2x\n", type);
*buff++ = 0; *buff++ = 0;
break; break;
} }
if (daddr != NULL) if (daddr != NULL)
return AX25_HEADER_LEN; return AX25_HEADER_LEN;
return -AX25_HEADER_LEN; /* Unfinished header */ return -AX25_HEADER_LEN; /* Unfinished header */
} }
@@ -114,8 +114,8 @@ int ax25_rebuild_header(struct sk_buff *skb)
dst = (ax25_address *)(bp + 1); dst = (ax25_address *)(bp + 1);
src = (ax25_address *)(bp + 8); src = (ax25_address *)(bp + 8);
if (arp_find(bp + 1, skb)) if (arp_find(bp + 1, skb))
return 1; return 1;
route = ax25_get_route(dst, NULL); route = ax25_get_route(dst, NULL);
if (route) { if (route) {
@@ -127,8 +127,8 @@ int ax25_rebuild_header(struct sk_buff *skb)
if (dev == NULL) if (dev == NULL)
dev = skb->dev; dev = skb->dev;
if ((ax25_dev = ax25_dev_ax25dev(dev)) == NULL) { if ((ax25_dev = ax25_dev_ax25dev(dev)) == NULL) {
goto put; goto put;
} }
if (bp[16] == AX25_P_IP) { if (bp[16] == AX25_P_IP) {
@@ -186,13 +186,13 @@ int ax25_rebuild_header(struct sk_buff *skb)
} }
} }
bp[7] &= ~AX25_CBIT; bp[7] &= ~AX25_CBIT;
bp[7] &= ~AX25_EBIT; bp[7] &= ~AX25_EBIT;
bp[7] |= AX25_SSSID_SPARE; bp[7] |= AX25_SSSID_SPARE;
bp[14] &= ~AX25_CBIT; bp[14] &= ~AX25_CBIT;
bp[14] |= AX25_EBIT; bp[14] |= AX25_EBIT;
bp[14] |= AX25_SSSID_SPARE; bp[14] |= AX25_SSSID_SPARE;
skb_pull(skb, AX25_KISS_HEADER_LEN); skb_pull(skb, AX25_KISS_HEADER_LEN);
@@ -211,7 +211,7 @@ put:
if (route) if (route)
ax25_put_route(route); ax25_put_route(route);
return 1; return 1;
} }
#else /* INET */ #else /* INET */

View File

@@ -87,7 +87,7 @@ static int __must_check ax25_rt_add(struct ax25_routes_struct *route)
ax25_rt = ax25_route_list; ax25_rt = ax25_route_list;
while (ax25_rt != NULL) { while (ax25_rt != NULL) {
if (ax25cmp(&ax25_rt->callsign, &route->dest_addr) == 0 && if (ax25cmp(&ax25_rt->callsign, &route->dest_addr) == 0 &&
ax25_rt->dev == ax25_dev->dev) { ax25_rt->dev == ax25_dev->dev) {
kfree(ax25_rt->digipeat); kfree(ax25_rt->digipeat);
ax25_rt->digipeat = NULL; ax25_rt->digipeat = NULL;
if (route->digi_count != 0) { if (route->digi_count != 0) {
@@ -253,7 +253,7 @@ static void *ax25_rt_seq_start(struct seq_file *seq, loff_t *pos)
struct ax25_route *ax25_rt; struct ax25_route *ax25_rt;
int i = 1; int i = 1;
read_lock(&ax25_route_lock); read_lock(&ax25_route_lock);
if (*pos == 0) if (*pos == 0)
return SEQ_START_TOKEN; return SEQ_START_TOKEN;

View File

@@ -56,7 +56,7 @@ void ax25_frames_acked(ax25_cb *ax25, unsigned short nr)
*/ */
if (ax25->va != nr) { if (ax25->va != nr) {
while (skb_peek(&ax25->ack_queue) != NULL && ax25->va != nr) { while (skb_peek(&ax25->ack_queue) != NULL && ax25->va != nr) {
skb = skb_dequeue(&ax25->ack_queue); skb = skb_dequeue(&ax25->ack_queue);
kfree_skb(skb); kfree_skb(skb);
ax25->va = (ax25->va + 1) % ax25->modulus; ax25->va = (ax25->va + 1) % ax25->modulus;
} }
@@ -65,7 +65,7 @@ void ax25_frames_acked(ax25_cb *ax25, unsigned short nr)
void ax25_requeue_frames(ax25_cb *ax25) void ax25_requeue_frames(ax25_cb *ax25)
{ {
struct sk_buff *skb, *skb_prev = NULL; struct sk_buff *skb, *skb_prev = NULL;
/* /*
* Requeue all the un-ack-ed frames on the output queue to be picked * Requeue all the un-ack-ed frames on the output queue to be picked

View File

@@ -164,7 +164,7 @@ static void *ax25_uid_seq_next(struct seq_file *seq, void *v, loff_t *pos)
++*pos; ++*pos;
return hlist_entry(((ax25_uid_assoc *)v)->uid_node.next, return hlist_entry(((ax25_uid_assoc *)v)->uid_node.next,
ax25_uid_assoc, uid_node); ax25_uid_assoc, uid_node);
} }
static void ax25_uid_seq_stop(struct seq_file *seq, void *v) static void ax25_uid_seq_stop(struct seq_file *seq, void *v)

View File

@@ -157,8 +157,8 @@ struct bnep_session {
struct list_head list; struct list_head list;
unsigned int role; unsigned int role;
unsigned long state; unsigned long state;
unsigned long flags; unsigned long flags;
atomic_t killed; atomic_t killed;
struct ethhdr eh; struct ethhdr eh;
@@ -178,7 +178,7 @@ int bnep_sock_cleanup(void);
static inline int bnep_mc_hash(__u8 *addr) static inline int bnep_mc_hash(__u8 *addr)
{ {
return (crc32_be(~0, addr, ETH_ALEN) >> 26); return (crc32_be(~0, addr, ETH_ALEN) >> 26);
} }
#endif #endif

View File

@@ -471,7 +471,7 @@ static int bnep_session(void *arg)
BT_DBG(""); BT_DBG("");
daemonize("kbnepd %s", dev->name); daemonize("kbnepd %s", dev->name);
set_user_nice(current, -15); set_user_nice(current, -15);
current->flags |= PF_NOFREEZE; current->flags |= PF_NOFREEZE;

View File

@@ -94,7 +94,7 @@ static void bnep_net_set_mc_list(struct net_device *dev)
r->type = BNEP_CONTROL; r->type = BNEP_CONTROL;
r->ctrl = BNEP_FILTER_MULTI_ADDR_SET; r->ctrl = BNEP_FILTER_MULTI_ADDR_SET;
if (dev->flags & (IFF_PROMISC | IFF_ALLMULTI)) { if (dev->flags & (IFF_PROMISC | IFF_ALLMULTI)) {
u8 start[ETH_ALEN] = { 0x01 }; u8 start[ETH_ALEN] = { 0x01 };
/* Request all addresses */ /* Request all addresses */
@@ -102,7 +102,7 @@ static void bnep_net_set_mc_list(struct net_device *dev)
memcpy(__skb_put(skb, ETH_ALEN), dev->broadcast, ETH_ALEN); memcpy(__skb_put(skb, ETH_ALEN), dev->broadcast, ETH_ALEN);
r->len = htons(ETH_ALEN * 2); r->len = htons(ETH_ALEN * 2);
} else { } else {
struct dev_mc_list *dmi = dev->mc_list; struct dev_mc_list *dmi = dev->mc_list;
int i, len = skb->len; int i, len = skb->len;
if (dev->flags & IFF_BROADCAST) { if (dev->flags & IFF_BROADCAST) {

View File

@@ -101,7 +101,7 @@ static int bnep_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long
err = bnep_add_connection(&ca, nsock); err = bnep_add_connection(&ca, nsock);
if (!err) { if (!err) {
if (copy_to_user(argp, &ca, sizeof(ca))) if (copy_to_user(argp, &ca, sizeof(ca)))
err = -EFAULT; err = -EFAULT;
} else } else
fput(nsock->file); fput(nsock->file);

View File

@@ -146,7 +146,7 @@ static void hci_conn_timeout(unsigned long arg)
case BT_CONNECT: case BT_CONNECT:
hci_acl_connect_cancel(conn); hci_acl_connect_cancel(conn);
break; break;
case BT_CONNECTED: case BT_CONNECTED:
hci_acl_disconn(conn, 0x13); hci_acl_disconn(conn, 0x13);
break; break;
default: default:

View File

@@ -293,7 +293,7 @@ static inline void hidp_process_handshake(struct hidp_session *session, unsigned
case HIDP_HSHK_ERR_FATAL: case HIDP_HSHK_ERR_FATAL:
/* Device requests a reboot, as this is the only way this error /* Device requests a reboot, as this is the only way this error
* can be recovered. */ * can be recovered. */
__hidp_send_ctrl_message(session, __hidp_send_ctrl_message(session,
HIDP_TRANS_HID_CONTROL | HIDP_CTRL_SOFT_RESET, NULL, 0); HIDP_TRANS_HID_CONTROL | HIDP_CTRL_SOFT_RESET, NULL, 0);
break; break;

View File

@@ -1652,7 +1652,7 @@ static inline int rfcomm_process_tx(struct rfcomm_dlc *d)
/* CFC enabled. /* CFC enabled.
* Give them some credits */ * Give them some credits */
if (!test_bit(RFCOMM_RX_THROTTLED, &d->flags) && if (!test_bit(RFCOMM_RX_THROTTLED, &d->flags) &&
d->rx_credits <= (d->cfc >> 2)) { d->rx_credits <= (d->cfc >> 2)) {
rfcomm_send_credits(d->session, d->addr, d->cfc - d->rx_credits); rfcomm_send_credits(d->session, d->addr, d->cfc - d->rx_credits);
d->rx_credits = d->cfc; d->rx_credits = d->cfc;
} }

View File

@@ -561,7 +561,7 @@ static void rfcomm_tty_wakeup(unsigned long arg)
BT_DBG("dev %p tty %p", dev, tty); BT_DBG("dev %p tty %p", dev, tty);
if (test_bit(TTY_DO_WRITE_WAKEUP, &tty->flags) && tty->ldisc.write_wakeup) if (test_bit(TTY_DO_WRITE_WAKEUP, &tty->flags) && tty->ldisc.write_wakeup)
(tty->ldisc.write_wakeup)(tty); (tty->ldisc.write_wakeup)(tty);
wake_up_interruptible(&tty->write_wait); wake_up_interruptible(&tty->write_wait);
#ifdef SERIAL_HAVE_POLL_WAIT #ifdef SERIAL_HAVE_POLL_WAIT
@@ -576,7 +576,7 @@ static int rfcomm_tty_open(struct tty_struct *tty, struct file *filp)
struct rfcomm_dlc *dlc; struct rfcomm_dlc *dlc;
int err, id; int err, id;
id = tty->index; id = tty->index;
BT_DBG("tty %p id %d", tty, id); BT_DBG("tty %p id %d", tty, id);
@@ -978,11 +978,11 @@ static int rfcomm_tty_read_proc(char *buf, char **start, off_t offset, int len,
static int rfcomm_tty_tiocmget(struct tty_struct *tty, struct file *filp) static int rfcomm_tty_tiocmget(struct tty_struct *tty, struct file *filp)
{ {
struct rfcomm_dev *dev = (struct rfcomm_dev *) tty->driver_data; struct rfcomm_dev *dev = (struct rfcomm_dev *) tty->driver_data;
BT_DBG("tty %p dev %p", tty, dev); BT_DBG("tty %p dev %p", tty, dev);
return dev->modem_status; return dev->modem_status;
} }
static int rfcomm_tty_tiocmset(struct tty_struct *tty, struct file *filp, unsigned int set, unsigned int clear) static int rfcomm_tty_tiocmset(struct tty_struct *tty, struct file *filp, unsigned int set, unsigned int clear)

View File

@@ -178,12 +178,12 @@ void br_dev_setup(struct net_device *dev)
dev->change_mtu = br_change_mtu; dev->change_mtu = br_change_mtu;
dev->destructor = free_netdev; dev->destructor = free_netdev;
SET_MODULE_OWNER(dev); SET_MODULE_OWNER(dev);
SET_ETHTOOL_OPS(dev, &br_ethtool_ops); SET_ETHTOOL_OPS(dev, &br_ethtool_ops);
dev->stop = br_dev_stop; dev->stop = br_dev_stop;
dev->tx_queue_len = 0; dev->tx_queue_len = 0;
dev->set_mac_address = br_set_mac_address; dev->set_mac_address = br_set_mac_address;
dev->priv_flags = IFF_EBRIDGE; dev->priv_flags = IFF_EBRIDGE;
dev->features = NETIF_F_SG | NETIF_F_FRAGLIST | NETIF_F_HIGHDMA | dev->features = NETIF_F_SG | NETIF_F_FRAGLIST | NETIF_F_HIGHDMA |
NETIF_F_TSO | NETIF_F_NO_CSUM | NETIF_F_GSO_ROBUST; NETIF_F_TSO | NETIF_F_NO_CSUM | NETIF_F_GSO_ROBUST;
} }

View File

@@ -317,7 +317,7 @@ static int fdb_insert(struct net_bridge *br, struct net_bridge_port *source,
"as a received packet\n", "as a received packet\n",
source->dev->name); source->dev->name);
fdb_delete(fdb); fdb_delete(fdb);
} }
if (!fdb_create(head, source, addr, 1)) if (!fdb_create(head, source, addr, 1))
return -ENOMEM; return -ENOMEM;

View File

@@ -191,7 +191,7 @@ static void del_br(struct net_bridge *br)
del_timer_sync(&br->gc_timer); del_timer_sync(&br->gc_timer);
br_sysfs_delbr(br->dev); br_sysfs_delbr(br->dev);
unregister_netdevice(br->dev); unregister_netdevice(br->dev);
} }
static struct net_device *new_bridge_dev(const char *name) static struct net_device *new_bridge_dev(const char *name)
@@ -276,7 +276,7 @@ static struct net_bridge_port *new_nbp(struct net_bridge *br,
dev_hold(dev); dev_hold(dev);
p->dev = dev; p->dev = dev;
p->path_cost = port_cost(dev); p->path_cost = port_cost(dev);
p->priority = 0x8000 >> BR_PORT_BITS; p->priority = 0x8000 >> BR_PORT_BITS;
p->port_no = index; p->port_no = index;
br_init_port(p); br_init_port(p);
p->state = BR_STATE_DISABLED; p->state = BR_STATE_DISABLED;
@@ -428,7 +428,7 @@ int br_add_if(struct net_bridge *br, struct net_device *dev)
if (err) if (err)
goto err0; goto err0;
err = br_fdb_insert(br, p, dev->dev_addr); err = br_fdb_insert(br, p, dev->dev_addr);
if (err) if (err)
goto err1; goto err1;

View File

@@ -143,7 +143,7 @@ static int old_dev_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
b.tcn_timer_value = br_timer_value(&br->tcn_timer); b.tcn_timer_value = br_timer_value(&br->tcn_timer);
b.topology_change_timer_value = br_timer_value(&br->topology_change_timer); b.topology_change_timer_value = br_timer_value(&br->topology_change_timer);
b.gc_timer_value = br_timer_value(&br->gc_timer); b.gc_timer_value = br_timer_value(&br->gc_timer);
rcu_read_unlock(); rcu_read_unlock();
if (copy_to_user((void __user *)args[1], &b, sizeof(b))) if (copy_to_user((void __user *)args[1], &b, sizeof(b)))
return -EFAULT; return -EFAULT;

View File

@@ -68,7 +68,7 @@ static __be16 inline vlan_proto(const struct sk_buff *skb)
#define IS_VLAN_IP(skb) \ #define IS_VLAN_IP(skb) \
(skb->protocol == htons(ETH_P_8021Q) && \ (skb->protocol == htons(ETH_P_8021Q) && \
vlan_proto(skb) == htons(ETH_P_IP) && \ vlan_proto(skb) == htons(ETH_P_IP) && \
brnf_filter_vlan_tagged) brnf_filter_vlan_tagged)
#define IS_VLAN_IPV6(skb) \ #define IS_VLAN_IPV6(skb) \
@@ -124,7 +124,7 @@ static inline struct nf_bridge_info *nf_bridge_alloc(struct sk_buff *skb)
static inline void nf_bridge_save_header(struct sk_buff *skb) static inline void nf_bridge_save_header(struct sk_buff *skb)
{ {
int header_size = ETH_HLEN; int header_size = ETH_HLEN;
if (skb->protocol == htons(ETH_P_8021Q)) if (skb->protocol == htons(ETH_P_8021Q))
header_size += VLAN_HLEN; header_size += VLAN_HLEN;
@@ -139,7 +139,7 @@ static inline void nf_bridge_save_header(struct sk_buff *skb)
int nf_bridge_copy_header(struct sk_buff *skb) int nf_bridge_copy_header(struct sk_buff *skb)
{ {
int err; int err;
int header_size = ETH_HLEN; int header_size = ETH_HLEN;
if (skb->protocol == htons(ETH_P_8021Q)) if (skb->protocol == htons(ETH_P_8021Q))
header_size += VLAN_HLEN; header_size += VLAN_HLEN;

View File

@@ -203,7 +203,7 @@ extern void br_netfilter_fini(void);
/* br_stp.c */ /* br_stp.c */
extern void br_log_state(const struct net_bridge_port *p); extern void br_log_state(const struct net_bridge_port *p);
extern struct net_bridge_port *br_get_port(struct net_bridge *br, extern struct net_bridge_port *br_get_port(struct net_bridge *br,
u16 port_no); u16 port_no);
extern void br_init_port(struct net_bridge_port *p); extern void br_init_port(struct net_bridge_port *p);
extern void br_become_designated_port(struct net_bridge_port *p); extern void br_become_designated_port(struct net_bridge_port *p);

View File

@@ -29,7 +29,7 @@
#define LLC_RESERVE sizeof(struct llc_pdu_un) #define LLC_RESERVE sizeof(struct llc_pdu_un)
static void br_send_bpdu(struct net_bridge_port *p, static void br_send_bpdu(struct net_bridge_port *p,
const unsigned char *data, int length) const unsigned char *data, int length)
{ {
struct sk_buff *skb; struct sk_buff *skb;

View File

@@ -51,7 +51,7 @@ static int ebt_target_reply(struct sk_buff **pskb, unsigned int hooknr,
return EBT_DROP; return EBT_DROP;
arp_send(ARPOP_REPLY, ETH_P_ARP, *siptr, (struct net_device *)in, arp_send(ARPOP_REPLY, ETH_P_ARP, *siptr, (struct net_device *)in,
*diptr, shp, info->mac, shp); *diptr, shp, info->mac, shp);
return info->target; return info->target;
} }

View File

@@ -61,15 +61,15 @@ static int ebt_filter_ip(const struct sk_buff *skb, const struct net_device *in,
if (info->bitmask & EBT_IP_DPORT) { if (info->bitmask & EBT_IP_DPORT) {
u32 dst = ntohs(pptr->dst); u32 dst = ntohs(pptr->dst);
if (FWINV(dst < info->dport[0] || if (FWINV(dst < info->dport[0] ||
dst > info->dport[1], dst > info->dport[1],
EBT_IP_DPORT)) EBT_IP_DPORT))
return EBT_NOMATCH; return EBT_NOMATCH;
} }
if (info->bitmask & EBT_IP_SPORT) { if (info->bitmask & EBT_IP_SPORT) {
u32 src = ntohs(pptr->src); u32 src = ntohs(pptr->src);
if (FWINV(src < info->sport[0] || if (FWINV(src < info->sport[0] ||
src > info->sport[1], src > info->sport[1],
EBT_IP_SPORT)) EBT_IP_SPORT))
return EBT_NOMATCH; return EBT_NOMATCH;
} }
} }

View File

@@ -169,10 +169,10 @@ static void ebt_log(const struct sk_buff *skb, unsigned int hooknr,
if (info->bitmask & EBT_LOG_NFLOG) if (info->bitmask & EBT_LOG_NFLOG)
nf_log_packet(PF_BRIDGE, hooknr, skb, in, out, &li, nf_log_packet(PF_BRIDGE, hooknr, skb, in, out, &li,
"%s", info->prefix); "%s", info->prefix);
else else
ebt_log_packet(PF_BRIDGE, hooknr, skb, in, out, &li, ebt_log_packet(PF_BRIDGE, hooknr, skb, in, out, &li,
info->prefix); info->prefix);
} }
static struct ebt_watcher log = static struct ebt_watcher log =

View File

@@ -26,7 +26,7 @@ static int ebt_filter_mark(const struct sk_buff *skb,
static int ebt_mark_check(const char *tablename, unsigned int hookmask, static int ebt_mark_check(const char *tablename, unsigned int hookmask,
const struct ebt_entry *e, void *data, unsigned int datalen) const struct ebt_entry *e, void *data, unsigned int datalen)
{ {
struct ebt_mark_m_info *info = (struct ebt_mark_m_info *) data; struct ebt_mark_m_info *info = (struct ebt_mark_m_info *) data;
if (datalen != EBT_ALIGN(sizeof(struct ebt_mark_m_info))) if (datalen != EBT_ALIGN(sizeof(struct ebt_mark_m_info)))
return -EINVAL; return -EINVAL;

View File

@@ -62,7 +62,7 @@ static int ebt_filter_config(struct ebt_stp_info *info,
verdict = 0; verdict = 0;
for (i = 0; i < 6; i++) for (i = 0; i < 6; i++)
verdict |= (stpc->root[2+i] ^ c->root_addr[i]) & verdict |= (stpc->root[2+i] ^ c->root_addr[i]) &
c->root_addrmsk[i]; c->root_addrmsk[i];
if (FWINV(verdict != 0, EBT_STP_ROOTADDR)) if (FWINV(verdict != 0, EBT_STP_ROOTADDR))
return EBT_NOMATCH; return EBT_NOMATCH;
} }
@@ -82,7 +82,7 @@ static int ebt_filter_config(struct ebt_stp_info *info,
verdict = 0; verdict = 0;
for (i = 0; i < 6; i++) for (i = 0; i < 6; i++)
verdict |= (stpc->sender[2+i] ^ c->sender_addr[i]) & verdict |= (stpc->sender[2+i] ^ c->sender_addr[i]) &
c->sender_addrmsk[i]; c->sender_addrmsk[i];
if (FWINV(verdict != 0, EBT_STP_SENDERADDR)) if (FWINV(verdict != 0, EBT_STP_SENDERADDR))
return EBT_NOMATCH; return EBT_NOMATCH;
} }

View File

@@ -43,17 +43,17 @@
#include "../br_private.h" #include "../br_private.h"
#define PRINTR(format, args...) do { if (net_ratelimit()) \ #define PRINTR(format, args...) do { if (net_ratelimit()) \
printk(format , ## args); } while (0) printk(format , ## args); } while (0)
static unsigned int nlbufsiz = NLMSG_GOODSIZE; static unsigned int nlbufsiz = NLMSG_GOODSIZE;
module_param(nlbufsiz, uint, 0600); module_param(nlbufsiz, uint, 0600);
MODULE_PARM_DESC(nlbufsiz, "netlink buffer size (number of bytes) " MODULE_PARM_DESC(nlbufsiz, "netlink buffer size (number of bytes) "
"(defaults to 4096)"); "(defaults to 4096)");
static unsigned int flushtimeout = 10; static unsigned int flushtimeout = 10;
module_param(flushtimeout, uint, 0600); module_param(flushtimeout, uint, 0600);
MODULE_PARM_DESC(flushtimeout, "buffer flush timeout (hundredths ofa second) " MODULE_PARM_DESC(flushtimeout, "buffer flush timeout (hundredths ofa second) "
"(defaults to 10)"); "(defaults to 10)");
typedef struct { typedef struct {
unsigned int qlen; /* number of nlmsgs' in the skb */ unsigned int qlen; /* number of nlmsgs' in the skb */
@@ -157,7 +157,7 @@ static void ebt_ulog_packet(unsigned int hooknr, const struct sk_buff *skb,
} }
nlh = NLMSG_PUT(ub->skb, 0, ub->qlen, 0, nlh = NLMSG_PUT(ub->skb, 0, ub->qlen, 0,
size - NLMSG_ALIGN(sizeof(*nlh))); size - NLMSG_ALIGN(sizeof(*nlh)));
ub->qlen++; ub->qlen++;
pm = NLMSG_DATA(nlh); pm = NLMSG_DATA(nlh);
@@ -302,7 +302,7 @@ static int __init ebt_ulog_init(void)
} }
ebtulognl = netlink_kernel_create(NETLINK_NFLOG, EBT_ULOG_MAXNLGROUPS, ebtulognl = netlink_kernel_create(NETLINK_NFLOG, EBT_ULOG_MAXNLGROUPS,
NULL, THIS_MODULE); NULL, THIS_MODULE);
if (!ebtulognl) if (!ebtulognl)
ret = -ENOMEM; ret = -ENOMEM;
else if ((ret = ebt_register_watcher(&ulog))) else if ((ret = ebt_register_watcher(&ulog)))
@@ -344,4 +344,4 @@ module_exit(ebt_ulog_fini);
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
MODULE_AUTHOR("Bart De Schuymer <bdschuym@pandora.be>"); MODULE_AUTHOR("Bart De Schuymer <bdschuym@pandora.be>");
MODULE_DESCRIPTION("ebtables userspace logging module for bridged Ethernet" MODULE_DESCRIPTION("ebtables userspace logging module for bridged Ethernet"
" frames"); " frames");

View File

@@ -33,10 +33,10 @@
#include "../br_private.h" #include "../br_private.h"
#define BUGPRINT(format, args...) printk("kernel msg: ebtables bug: please "\ #define BUGPRINT(format, args...) printk("kernel msg: ebtables bug: please "\
"report to author: "format, ## args) "report to author: "format, ## args)
/* #define BUGPRINT(format, args...) */ /* #define BUGPRINT(format, args...) */
#define MEMPRINT(format, args...) printk("kernel msg: ebtables "\ #define MEMPRINT(format, args...) printk("kernel msg: ebtables "\
": out of memory: "format, ## args) ": out of memory: "format, ## args)
/* #define MEMPRINT(format, args...) */ /* #define MEMPRINT(format, args...) */
@@ -482,7 +482,7 @@ ebt_check_entry_size_and_hooks(struct ebt_entry *e,
as it said it has */ as it said it has */
if (*n != *cnt) { if (*n != *cnt) {
BUGPRINT("nentries does not equal the nr of entries " BUGPRINT("nentries does not equal the nr of entries "
"in the chain\n"); "in the chain\n");
return -EINVAL; return -EINVAL;
} }
if (((struct ebt_entries *)e)->policy != EBT_DROP && if (((struct ebt_entries *)e)->policy != EBT_DROP &&
@@ -809,7 +809,7 @@ static int translate_table(char *name, struct ebt_table_info *newinfo)
i = 0; /* holds the expected nr. of entries for the chain */ i = 0; /* holds the expected nr. of entries for the chain */
j = 0; /* holds the up to now counted entries for the chain */ j = 0; /* holds the up to now counted entries for the chain */
k = 0; /* holds the total nr. of entries, should equal k = 0; /* holds the total nr. of entries, should equal
newinfo->nentries afterwards */ newinfo->nentries afterwards */
udc_cnt = 0; /* will hold the nr. of user defined chains (udc) */ udc_cnt = 0; /* will hold the nr. of user defined chains (udc) */
ret = EBT_ENTRY_ITERATE(newinfo->entries, newinfo->entries_size, ret = EBT_ENTRY_ITERATE(newinfo->entries, newinfo->entries_size,
ebt_check_entry_size_and_hooks, newinfo, ebt_check_entry_size_and_hooks, newinfo,
@@ -820,7 +820,7 @@ static int translate_table(char *name, struct ebt_table_info *newinfo)
if (i != j) { if (i != j) {
BUGPRINT("nentries does not equal the nr of entries in the " BUGPRINT("nentries does not equal the nr of entries in the "
"(last) chain\n"); "(last) chain\n");
return -EINVAL; return -EINVAL;
} }
if (k != newinfo->nentries) { if (k != newinfo->nentries) {
@@ -835,7 +835,7 @@ static int translate_table(char *name, struct ebt_table_info *newinfo)
if an error occurs */ if an error occurs */
newinfo->chainstack = newinfo->chainstack =
vmalloc((highest_possible_processor_id()+1) vmalloc((highest_possible_processor_id()+1)
* sizeof(*(newinfo->chainstack))); * sizeof(*(newinfo->chainstack)));
if (!newinfo->chainstack) if (!newinfo->chainstack)
return -ENOMEM; return -ENOMEM;
for_each_possible_cpu(i) { for_each_possible_cpu(i) {

View File

@@ -860,7 +860,7 @@ int dev_open(struct net_device *dev)
clear_bit(__LINK_STATE_START, &dev->state); clear_bit(__LINK_STATE_START, &dev->state);
} }
/* /*
* If it went open OK then: * If it went open OK then:
*/ */
@@ -1157,7 +1157,7 @@ void netif_device_attach(struct net_device *dev)
if (!test_and_set_bit(__LINK_STATE_PRESENT, &dev->state) && if (!test_and_set_bit(__LINK_STATE_PRESENT, &dev->state) &&
netif_running(dev)) { netif_running(dev)) {
netif_wake_queue(dev); netif_wake_queue(dev);
__netdev_watchdog_up(dev); __netdev_watchdog_up(dev);
} }
} }
EXPORT_SYMBOL(netif_device_attach); EXPORT_SYMBOL(netif_device_attach);
@@ -1449,8 +1449,8 @@ int dev_queue_xmit(struct sk_buff *skb)
(!(dev->features & NETIF_F_GEN_CSUM) && (!(dev->features & NETIF_F_GEN_CSUM) &&
(!(dev->features & NETIF_F_IP_CSUM) || (!(dev->features & NETIF_F_IP_CSUM) ||
skb->protocol != htons(ETH_P_IP)))) skb->protocol != htons(ETH_P_IP))))
if (skb_checksum_help(skb)) if (skb_checksum_help(skb))
goto out_kfree_skb; goto out_kfree_skb;
gso: gso:
spin_lock_prefetch(&dev->queue_lock); spin_lock_prefetch(&dev->queue_lock);
@@ -2061,7 +2061,7 @@ static int dev_ifconf(char __user *arg)
total += done; total += done;
} }
} }
} }
/* /*
* All done. Write the updated control block back to the caller. * All done. Write the updated control block back to the caller.
@@ -2154,7 +2154,7 @@ static struct netif_rx_stats *softnet_get_online(loff_t *pos)
struct netif_rx_stats *rc = NULL; struct netif_rx_stats *rc = NULL;
while (*pos < NR_CPUS) while (*pos < NR_CPUS)
if (cpu_online(*pos)) { if (cpu_online(*pos)) {
rc = &per_cpu(netdev_rx_stat, *pos); rc = &per_cpu(netdev_rx_stat, *pos);
break; break;
} else } else
@@ -2319,7 +2319,7 @@ void dev_set_promiscuity(struct net_device *dev, int inc)
dev_mc_upload(dev); dev_mc_upload(dev);
printk(KERN_INFO "device %s %s promiscuous mode\n", printk(KERN_INFO "device %s %s promiscuous mode\n",
dev->name, (dev->flags & IFF_PROMISC) ? "entered" : dev->name, (dev->flags & IFF_PROMISC) ? "entered" :
"left"); "left");
audit_log(current->audit_context, GFP_ATOMIC, audit_log(current->audit_context, GFP_ATOMIC,
AUDIT_ANOM_PROMISCUOUS, AUDIT_ANOM_PROMISCUOUS,
"dev=%s prom=%d old_prom=%d auid=%u", "dev=%s prom=%d old_prom=%d auid=%u",
@@ -2816,7 +2816,7 @@ int dev_ioctl(unsigned int cmd, void __user *arg)
rtnl_unlock(); rtnl_unlock();
if (IW_IS_GET(cmd) && if (IW_IS_GET(cmd) &&
copy_to_user(arg, &ifr, copy_to_user(arg, &ifr,
sizeof(struct ifreq))) sizeof(struct ifreq)))
ret = -EFAULT; ret = -EFAULT;
return ret; return ret;
} }
@@ -2923,9 +2923,9 @@ int register_netdevice(struct net_device *dev)
= hlist_entry(p, struct net_device, name_hlist); = hlist_entry(p, struct net_device, name_hlist);
if (!strncmp(d->name, dev->name, IFNAMSIZ)) { if (!strncmp(d->name, dev->name, IFNAMSIZ)) {
ret = -EEXIST; ret = -EEXIST;
goto out; goto out;
} }
} }
/* Fix illegal SG+CSUM combinations. */ /* Fix illegal SG+CSUM combinations. */
if ((dev->features & NETIF_F_SG) && if ((dev->features & NETIF_F_SG) &&

View File

@@ -53,7 +53,7 @@ static void *__load_pointer(struct sk_buff *skb, int k)
} }
static inline void *load_pointer(struct sk_buff *skb, int k, static inline void *load_pointer(struct sk_buff *skb, int k,
unsigned int size, void *buffer) unsigned int size, void *buffer)
{ {
if (k >= 0) if (k >= 0)
return skb_header_pointer(skb, k, size, buffer); return skb_header_pointer(skb, k, size, buffer);

View File

@@ -209,7 +209,7 @@ int csum_partial_copy_fromiovecend(unsigned char *kdata, struct iovec *iov,
if (partial_cnt) { if (partial_cnt) {
copy -= partial_cnt; copy -= partial_cnt;
if (copy_from_user(kdata + copy, base + copy, if (copy_from_user(kdata + copy, base + copy,
partial_cnt)) partial_cnt))
goto out_fault; goto out_fault;
} }
} }
@@ -224,7 +224,7 @@ int csum_partial_copy_fromiovecend(unsigned char *kdata, struct iovec *iov,
kdata += copy + partial_cnt; kdata += copy + partial_cnt;
iov++; iov++;
} }
*csump = csum; *csump = csum;
out: out:
return err; return err;

View File

@@ -685,9 +685,9 @@ next_elt:
np = &n->next; np = &n->next;
} }
/* Cycle through all hash buckets every base_reachable_time/2 ticks. /* Cycle through all hash buckets every base_reachable_time/2 ticks.
* ARP entry timeouts range from 1/2 base_reachable_time to 3/2 * ARP entry timeouts range from 1/2 base_reachable_time to 3/2
* base_reachable_time. * base_reachable_time.
*/ */
expire = tbl->parms.base_reachable_time >> 1; expire = tbl->parms.base_reachable_time >> 1;
expire /= (tbl->hash_mask + 1); expire /= (tbl->hash_mask + 1);
@@ -1127,7 +1127,7 @@ int neigh_compat_output(struct sk_buff *skb)
if (dev->hard_header && if (dev->hard_header &&
dev->hard_header(skb, dev, ntohs(skb->protocol), NULL, NULL, dev->hard_header(skb, dev, ntohs(skb->protocol), NULL, NULL,
skb->len) < 0 && skb->len) < 0 &&
dev->rebuild_header(skb)) dev->rebuild_header(skb))
return 0; return 0;
@@ -2661,7 +2661,7 @@ int neigh_sysctl_register(struct net_device *dev, struct neigh_parms *p,
t->neigh_vars[14].procname = NULL; t->neigh_vars[14].procname = NULL;
t->neigh_vars[15].procname = NULL; t->neigh_vars[15].procname = NULL;
} else { } else {
dev_name_source = t->neigh_dev[0].procname; dev_name_source = t->neigh_dev[0].procname;
t->neigh_vars[12].data = (int *)(p + 1); t->neigh_vars[12].data = (int *)(p + 1);
t->neigh_vars[13].data = (int *)(p + 1) + 1; t->neigh_vars[13].data = (int *)(p + 1) + 1;
t->neigh_vars[14].data = (int *)(p + 1) + 2; t->neigh_vars[14].data = (int *)(p + 1) + 2;
@@ -2696,7 +2696,7 @@ int neigh_sysctl_register(struct net_device *dev, struct neigh_parms *p,
goto free; goto free;
} }
t->neigh_dev[0].procname = dev_name; t->neigh_dev[0].procname = dev_name;
t->neigh_neigh_dir[0].ctl_name = pdev_id; t->neigh_neigh_dir[0].ctl_name = pdev_id;

View File

@@ -237,13 +237,13 @@ static void netpoll_send_skb(struct netpoll *np, struct sk_buff *skb)
{ {
int status = NETDEV_TX_BUSY; int status = NETDEV_TX_BUSY;
unsigned long tries; unsigned long tries;
struct net_device *dev = np->dev; struct net_device *dev = np->dev;
struct netpoll_info *npinfo = np->dev->npinfo; struct netpoll_info *npinfo = np->dev->npinfo;
if (!npinfo || !netif_running(dev) || !netif_device_present(dev)) { if (!npinfo || !netif_running(dev) || !netif_device_present(dev)) {
__kfree_skb(skb); __kfree_skb(skb);
return; return;
} }
/* don't get messages out of order, and no recursion */ /* don't get messages out of order, and no recursion */
if (skb_queue_len(&npinfo->txq) == 0 && if (skb_queue_len(&npinfo->txq) == 0 &&
@@ -676,7 +676,7 @@ int netpoll_setup(struct netpoll *np)
} }
atleast = jiffies + HZ/10; atleast = jiffies + HZ/10;
atmost = jiffies + 4*HZ; atmost = jiffies + 4*HZ;
while (!netif_carrier_ok(ndev)) { while (!netif_carrier_ok(ndev)) {
if (time_after(jiffies, atmost)) { if (time_after(jiffies, atmost)) {
printk(KERN_NOTICE printk(KERN_NOTICE
@@ -772,9 +772,9 @@ void netpoll_cleanup(struct netpoll *np)
np->dev->npinfo = NULL; np->dev->npinfo = NULL;
if (atomic_dec_and_test(&npinfo->refcnt)) { if (atomic_dec_and_test(&npinfo->refcnt)) {
skb_queue_purge(&npinfo->arp_tx); skb_queue_purge(&npinfo->arp_tx);
skb_queue_purge(&npinfo->txq); skb_queue_purge(&npinfo->txq);
cancel_rearming_delayed_work(&npinfo->tx_work); cancel_rearming_delayed_work(&npinfo->tx_work);
flush_scheduled_work(); flush_scheduled_work();
kfree(npinfo); kfree(npinfo);
} }

View File

@@ -874,7 +874,7 @@ void __init rtnetlink_init(void)
panic("rtnetlink_init: cannot allocate rta_buf\n"); panic("rtnetlink_init: cannot allocate rta_buf\n");
rtnl = netlink_kernel_create(NETLINK_ROUTE, RTNLGRP_MAX, rtnetlink_rcv, rtnl = netlink_kernel_create(NETLINK_ROUTE, RTNLGRP_MAX, rtnetlink_rcv,
THIS_MODULE); THIS_MODULE);
if (rtnl == NULL) if (rtnl == NULL)
panic("rtnetlink_init: cannot initialize rtnetlink\n"); panic("rtnetlink_init: cannot initialize rtnetlink\n");
netlink_set_nonroot(NETLINK_ROUTE, NL_NONROOT_RECV); netlink_set_nonroot(NETLINK_ROUTE, NL_NONROOT_RECV);

View File

@@ -88,7 +88,7 @@ static struct kmem_cache *skbuff_fclone_cache __read_mostly;
void skb_over_panic(struct sk_buff *skb, int sz, void *here) void skb_over_panic(struct sk_buff *skb, int sz, void *here)
{ {
printk(KERN_EMERG "skb_over_panic: text:%p len:%d put:%d head:%p " printk(KERN_EMERG "skb_over_panic: text:%p len:%d put:%d head:%p "
"data:%p tail:%p end:%p dev:%s\n", "data:%p tail:%p end:%p dev:%s\n",
here, skb->len, sz, skb->head, skb->data, skb->tail, skb->end, here, skb->len, sz, skb->head, skb->data, skb->tail, skb->end,
skb->dev ? skb->dev->name : "<NULL>"); skb->dev ? skb->dev->name : "<NULL>");
BUG(); BUG();
@@ -106,7 +106,7 @@ void skb_over_panic(struct sk_buff *skb, int sz, void *here)
void skb_under_panic(struct sk_buff *skb, int sz, void *here) void skb_under_panic(struct sk_buff *skb, int sz, void *here)
{ {
printk(KERN_EMERG "skb_under_panic: text:%p len:%d put:%d head:%p " printk(KERN_EMERG "skb_under_panic: text:%p len:%d put:%d head:%p "
"data:%p tail:%p end:%p dev:%s\n", "data:%p tail:%p end:%p dev:%s\n",
here, skb->len, sz, skb->head, skb->data, skb->tail, skb->end, here, skb->len, sz, skb->head, skb->data, skb->tail, skb->end,
skb->dev ? skb->dev->name : "<NULL>"); skb->dev ? skb->dev->name : "<NULL>");
BUG(); BUG();
@@ -271,7 +271,7 @@ struct sk_buff *__netdev_alloc_skb(struct net_device *dev,
int node = dev->dev.parent ? dev_to_node(dev->dev.parent) : -1; int node = dev->dev.parent ? dev_to_node(dev->dev.parent) : -1;
struct sk_buff *skb; struct sk_buff *skb;
skb = __alloc_skb(length + NET_SKB_PAD, gfp_mask, 0, node); skb = __alloc_skb(length + NET_SKB_PAD, gfp_mask, 0, node);
if (likely(skb)) { if (likely(skb)) {
skb_reserve(skb, NET_SKB_PAD); skb_reserve(skb, NET_SKB_PAD);
skb->dev = dev; skb->dev = dev;

View File

@@ -361,18 +361,18 @@ int sock_setsockopt(struct socket *sock, int level, int optname,
} }
#endif #endif
if(optlen<sizeof(int)) if(optlen<sizeof(int))
return(-EINVAL); return(-EINVAL);
if (get_user(val, (int __user *)optval)) if (get_user(val, (int __user *)optval))
return -EFAULT; return -EFAULT;
valbool = val?1:0; valbool = val?1:0;
lock_sock(sk); lock_sock(sk);
switch(optname) switch(optname)
{ {
case SO_DEBUG: case SO_DEBUG:
if(val && !capable(CAP_NET_ADMIN)) if(val && !capable(CAP_NET_ADMIN))
{ {
@@ -389,7 +389,7 @@ int sock_setsockopt(struct socket *sock, int level, int optname,
case SO_TYPE: case SO_TYPE:
case SO_ERROR: case SO_ERROR:
ret = -ENOPROTOOPT; ret = -ENOPROTOOPT;
break; break;
case SO_DONTROUTE: case SO_DONTROUTE:
if (valbool) if (valbool)
sock_set_flag(sk, SOCK_LOCALROUTE); sock_set_flag(sk, SOCK_LOCALROUTE);
@@ -474,11 +474,11 @@ set_rcvbuf:
sock_valbool_flag(sk, SOCK_KEEPOPEN, valbool); sock_valbool_flag(sk, SOCK_KEEPOPEN, valbool);
break; break;
case SO_OOBINLINE: case SO_OOBINLINE:
sock_valbool_flag(sk, SOCK_URGINLINE, valbool); sock_valbool_flag(sk, SOCK_URGINLINE, valbool);
break; break;
case SO_NO_CHECK: case SO_NO_CHECK:
sk->sk_no_check = valbool; sk->sk_no_check = valbool;
break; break;
@@ -608,7 +608,7 @@ set_rcvbuf:
case SO_DETACH_FILTER: case SO_DETACH_FILTER:
rcu_read_lock_bh(); rcu_read_lock_bh();
filter = rcu_dereference(sk->sk_filter); filter = rcu_dereference(sk->sk_filter);
if (filter) { if (filter) {
rcu_assign_pointer(sk->sk_filter, NULL); rcu_assign_pointer(sk->sk_filter, NULL);
sk_filter_release(sk, filter); sk_filter_release(sk, filter);
rcu_read_unlock_bh(); rcu_read_unlock_bh();
@@ -628,9 +628,9 @@ set_rcvbuf:
/* We implement the SO_SNDLOWAT etc to /* We implement the SO_SNDLOWAT etc to
not be settable (1003.1g 5.3) */ not be settable (1003.1g 5.3) */
default: default:
ret = -ENOPROTOOPT; ret = -ENOPROTOOPT;
break; break;
} }
release_sock(sk); release_sock(sk);
return ret; return ret;
} }
@@ -643,21 +643,21 @@ int sock_getsockopt(struct socket *sock, int level, int optname,
union union
{ {
int val; int val;
struct linger ling; struct linger ling;
struct timeval tm; struct timeval tm;
} v; } v;
unsigned int lv = sizeof(int); unsigned int lv = sizeof(int);
int len; int len;
if(get_user(len,optlen)) if(get_user(len,optlen))
return -EFAULT; return -EFAULT;
if(len < 0) if(len < 0)
return -EINVAL; return -EINVAL;
switch(optname) switch(optname)
{ {
case SO_DEBUG: case SO_DEBUG:
v.val = sock_flag(sk, SOCK_DBG); v.val = sock_flag(sk, SOCK_DBG);
break; break;
@@ -711,7 +711,7 @@ int sock_getsockopt(struct socket *sock, int level, int optname,
case SO_LINGER: case SO_LINGER:
lv = sizeof(v.ling); lv = sizeof(v.ling);
v.ling.l_onoff = !!sock_flag(sk, SOCK_LINGER); v.ling.l_onoff = !!sock_flag(sk, SOCK_LINGER);
v.ling.l_linger = sk->sk_lingertime / HZ; v.ling.l_linger = sk->sk_lingertime / HZ;
break; break;
case SO_BSDCOMPAT: case SO_BSDCOMPAT:
@@ -798,9 +798,9 @@ int sock_getsockopt(struct socket *sock, int level, int optname,
if (copy_to_user(optval, &v, len)) if (copy_to_user(optval, &v, len))
return -EFAULT; return -EFAULT;
lenout: lenout:
if (put_user(len, optlen)) if (put_user(len, optlen))
return -EFAULT; return -EFAULT;
return 0; return 0;
} }
/* /*
@@ -1074,7 +1074,7 @@ void *sock_kmalloc(struct sock *sk, int size, gfp_t priority)
atomic_read(&sk->sk_omem_alloc) + size < sysctl_optmem_max) { atomic_read(&sk->sk_omem_alloc) + size < sysctl_optmem_max) {
void *mem; void *mem;
/* First do the add, to avoid the race if kmalloc /* First do the add, to avoid the race if kmalloc
* might sleep. * might sleep.
*/ */
atomic_add(size, &sk->sk_omem_alloc); atomic_add(size, &sk->sk_omem_alloc);
mem = kmalloc(size, priority); mem = kmalloc(size, priority);

View File

@@ -58,7 +58,7 @@ int dma_skb_copy_datagram_iovec(struct dma_chan *chan,
if (copy > len) if (copy > len)
copy = len; copy = len;
cookie = dma_memcpy_to_iovec(chan, to, pinned_list, cookie = dma_memcpy_to_iovec(chan, to, pinned_list,
skb->data + offset, copy); skb->data + offset, copy);
if (cookie < 0) if (cookie < 0)
goto fault; goto fault;
len -= copy; len -= copy;
@@ -108,8 +108,8 @@ int dma_skb_copy_datagram_iovec(struct dma_chan *chan,
if (copy > len) if (copy > len)
copy = len; copy = len;
cookie = dma_skb_copy_datagram_iovec(chan, list, cookie = dma_skb_copy_datagram_iovec(chan, list,
offset - start, to, copy, offset - start, to, copy,
pinned_list); pinned_list);
if (cookie < 0) if (cookie < 0)
goto fault; goto fault;
len -= copy; len -= copy;
@@ -128,5 +128,5 @@ end:
} }
fault: fault:
return -EFAULT; return -EFAULT;
} }

View File

@@ -2015,7 +2015,7 @@ void wireless_send_event(struct net_device * dev,
* The best the driver could do is to log an error message. * The best the driver could do is to log an error message.
* We will do it ourselves instead... * We will do it ourselves instead...
*/ */
printk(KERN_ERR "%s (WE) : Invalid/Unknown Wireless Event (0x%04X)\n", printk(KERN_ERR "%s (WE) : Invalid/Unknown Wireless Event (0x%04X)\n",
dev->name, cmd); dev->name, cmd);
return; return;
} }
@@ -2029,11 +2029,11 @@ void wireless_send_event(struct net_device * dev,
if(descr->header_type == IW_HEADER_TYPE_POINT) { if(descr->header_type == IW_HEADER_TYPE_POINT) {
/* Check if number of token fits within bounds */ /* Check if number of token fits within bounds */
if(wrqu->data.length > descr->max_tokens) { if(wrqu->data.length > descr->max_tokens) {
printk(KERN_ERR "%s (WE) : Wireless Event too big (%d)\n", dev->name, wrqu->data.length); printk(KERN_ERR "%s (WE) : Wireless Event too big (%d)\n", dev->name, wrqu->data.length);
return; return;
} }
if(wrqu->data.length < descr->min_tokens) { if(wrqu->data.length < descr->min_tokens) {
printk(KERN_ERR "%s (WE) : Wireless Event too small (%d)\n", dev->name, wrqu->data.length); printk(KERN_ERR "%s (WE) : Wireless Event too small (%d)\n", dev->name, wrqu->data.length);
return; return;
} }
/* Calculate extra_len - extra is NULL for restricted events */ /* Calculate extra_len - extra is NULL for restricted events */

View File

@@ -139,7 +139,7 @@ static int ccid2_hc_tx_send_packet(struct sock *sk, struct sk_buff *skb)
return 0; return 0;
} }
hctx = ccid2_hc_tx_sk(sk); hctx = ccid2_hc_tx_sk(sk);
ccid2_pr_debug("pipe=%d cwnd=%d\n", hctx->ccid2hctx_pipe, ccid2_pr_debug("pipe=%d cwnd=%d\n", hctx->ccid2hctx_pipe,
hctx->ccid2hctx_cwnd); hctx->ccid2hctx_cwnd);
@@ -368,13 +368,13 @@ static void ccid2_hc_tx_packet_sent(struct sock *sk, int more, unsigned int len)
static int ccid2_ackvector(struct sock *sk, struct sk_buff *skb, int offset, static int ccid2_ackvector(struct sock *sk, struct sk_buff *skb, int offset,
unsigned char **vec, unsigned char *veclen) unsigned char **vec, unsigned char *veclen)
{ {
const struct dccp_hdr *dh = dccp_hdr(skb); const struct dccp_hdr *dh = dccp_hdr(skb);
unsigned char *options = (unsigned char *)dh + dccp_hdr_len(skb); unsigned char *options = (unsigned char *)dh + dccp_hdr_len(skb);
unsigned char *opt_ptr; unsigned char *opt_ptr;
const unsigned char *opt_end = (unsigned char *)dh + const unsigned char *opt_end = (unsigned char *)dh +
(dh->dccph_doff * 4); (dh->dccph_doff * 4);
unsigned char opt, len; unsigned char opt, len;
unsigned char *value; unsigned char *value;
BUG_ON(offset < 0); BUG_ON(offset < 0);
options += offset; options += offset;
@@ -383,29 +383,29 @@ static int ccid2_ackvector(struct sock *sk, struct sk_buff *skb, int offset,
return -1; return -1;
while (opt_ptr != opt_end) { while (opt_ptr != opt_end) {
opt = *opt_ptr++; opt = *opt_ptr++;
len = 0; len = 0;
value = NULL; value = NULL;
/* Check if this isn't a single byte option */ /* Check if this isn't a single byte option */
if (opt > DCCPO_MAX_RESERVED) { if (opt > DCCPO_MAX_RESERVED) {
if (opt_ptr == opt_end) if (opt_ptr == opt_end)
goto out_invalid_option; goto out_invalid_option;
len = *opt_ptr++; len = *opt_ptr++;
if (len < 3) if (len < 3)
goto out_invalid_option; goto out_invalid_option;
/* /*
* Remove the type and len fields, leaving * Remove the type and len fields, leaving
* just the value size * just the value size
*/ */
len -= 2; len -= 2;
value = opt_ptr; value = opt_ptr;
opt_ptr += len; opt_ptr += len;
if (opt_ptr > opt_end) if (opt_ptr > opt_end)
goto out_invalid_option; goto out_invalid_option;
} }
switch (opt) { switch (opt) {
case DCCPO_ACK_VECTOR_0: case DCCPO_ACK_VECTOR_0:
@@ -432,7 +432,7 @@ static void ccid2_hc_tx_kill_rto_timer(struct sock *sk)
} }
static inline void ccid2_new_ack(struct sock *sk, static inline void ccid2_new_ack(struct sock *sk,
struct ccid2_seq *seqp, struct ccid2_seq *seqp,
unsigned int *maxincr) unsigned int *maxincr)
{ {
struct ccid2_hc_tx_sock *hctx = ccid2_hc_tx_sk(sk); struct ccid2_hc_tx_sock *hctx = ccid2_hc_tx_sk(sk);
@@ -759,7 +759,7 @@ static void ccid2_hc_tx_packet_recv(struct sock *sk, struct sk_buff *skb)
static int ccid2_hc_tx_init(struct ccid *ccid, struct sock *sk) static int ccid2_hc_tx_init(struct ccid *ccid, struct sock *sk)
{ {
struct ccid2_hc_tx_sock *hctx = ccid_priv(ccid); struct ccid2_hc_tx_sock *hctx = ccid_priv(ccid);
ccid2_change_cwnd(hctx, 1); ccid2_change_cwnd(hctx, 1);
/* Initialize ssthresh to infinity. This means that we will exit the /* Initialize ssthresh to infinity. This means that we will exit the
@@ -793,7 +793,7 @@ static int ccid2_hc_tx_init(struct ccid *ccid, struct sock *sk)
static void ccid2_hc_tx_exit(struct sock *sk) static void ccid2_hc_tx_exit(struct sock *sk)
{ {
struct ccid2_hc_tx_sock *hctx = ccid2_hc_tx_sk(sk); struct ccid2_hc_tx_sock *hctx = ccid2_hc_tx_sk(sk);
int i; int i;
ccid2_hc_tx_kill_rto_timer(sk); ccid2_hc_tx_kill_rto_timer(sk);

View File

@@ -284,7 +284,7 @@ static void ccid3_hc_tx_no_feedback_timer(unsigned long data)
restart_timer: restart_timer:
sk_reset_timer(sk, &hctx->ccid3hctx_no_feedback_timer, sk_reset_timer(sk, &hctx->ccid3hctx_no_feedback_timer,
jiffies + usecs_to_jiffies(t_nfb)); jiffies + usecs_to_jiffies(t_nfb));
out: out:
bh_unlock_sock(sk); bh_unlock_sock(sk);
sock_put(sk); sock_put(sk);
@@ -319,7 +319,7 @@ static int ccid3_hc_tx_send_packet(struct sock *sk, struct sk_buff *skb)
case TFRC_SSTATE_NO_SENT: case TFRC_SSTATE_NO_SENT:
sk_reset_timer(sk, &hctx->ccid3hctx_no_feedback_timer, sk_reset_timer(sk, &hctx->ccid3hctx_no_feedback_timer,
(jiffies + (jiffies +
usecs_to_jiffies(TFRC_INITIAL_TIMEOUT))); usecs_to_jiffies(TFRC_INITIAL_TIMEOUT)));
hctx->ccid3hctx_last_win_count = 0; hctx->ccid3hctx_last_win_count = 0;
hctx->ccid3hctx_t_last_win_count = now; hctx->ccid3hctx_t_last_win_count = now;
ccid3_hc_tx_set_state(sk, TFRC_SSTATE_NO_FBACK); ccid3_hc_tx_set_state(sk, TFRC_SSTATE_NO_FBACK);
@@ -487,7 +487,7 @@ static void ccid3_hc_tx_packet_recv(struct sock *sk, struct sk_buff *skb)
ccid3_hc_tx_set_state(sk, TFRC_SSTATE_FBACK); ccid3_hc_tx_set_state(sk, TFRC_SSTATE_FBACK);
} else { } else {
hctx->ccid3hctx_rtt = (9 * hctx->ccid3hctx_rtt + hctx->ccid3hctx_rtt = (9 * hctx->ccid3hctx_rtt +
(u32)r_sample) / 10; (u32)r_sample) / 10;
/* Update sending rate (step 4 of [RFC 3448, 4.3]) */ /* Update sending rate (step 4 of [RFC 3448, 4.3]) */
if (hctx->ccid3hctx_p > 0) if (hctx->ccid3hctx_p > 0)
@@ -924,7 +924,7 @@ static void ccid3_hc_rx_update_li(struct sock *sk, u64 seq_loss, u8 win_loss)
} }
static int ccid3_hc_rx_detect_loss(struct sock *sk, static int ccid3_hc_rx_detect_loss(struct sock *sk,
struct dccp_rx_hist_entry *packet) struct dccp_rx_hist_entry *packet)
{ {
struct ccid3_hc_rx_sock *hcrx = ccid3_hc_rx_sk(sk); struct ccid3_hc_rx_sock *hcrx = ccid3_hc_rx_sk(sk);
struct dccp_rx_hist_entry *rx_hist = struct dccp_rx_hist_entry *rx_hist =

View File

@@ -137,7 +137,7 @@ extern void dccp_rx_hist_delete(struct dccp_rx_hist *hist);
static inline struct dccp_rx_hist_entry * static inline struct dccp_rx_hist_entry *
dccp_rx_hist_entry_new(struct dccp_rx_hist *hist, dccp_rx_hist_entry_new(struct dccp_rx_hist *hist,
const struct sock *sk, const struct sock *sk,
const u32 ndp, const u32 ndp,
const struct sk_buff *skb, const struct sk_buff *skb,
const gfp_t prio) const gfp_t prio)
{ {
@@ -169,7 +169,7 @@ static inline struct dccp_rx_hist_entry *
} }
extern int dccp_rx_hist_find_entry(const struct list_head *list, const u64 seq, extern int dccp_rx_hist_find_entry(const struct list_head *list, const u64 seq,
u8 *ccval); u8 *ccval);
extern struct dccp_rx_hist_entry * extern struct dccp_rx_hist_entry *
dccp_rx_hist_find_data_packet(const struct list_head *list); dccp_rx_hist_find_data_packet(const struct list_head *list);

View File

@@ -26,7 +26,7 @@
The following two-column lookup table implements a part of the TCP throughput The following two-column lookup table implements a part of the TCP throughput
equation from [RFC 3448, sec. 3.1]: equation from [RFC 3448, sec. 3.1]:
s s
X_calc = -------------------------------------------------------------- X_calc = --------------------------------------------------------------
R * sqrt(2*b*p/3) + (3 * t_RTO * sqrt(3*b*p/8) * (p + 32*p^3)) R * sqrt(2*b*p/3) + (3 * t_RTO * sqrt(3*b*p/8) * (p + 32*p^3))
@@ -35,7 +35,7 @@
s is the packet size in bytes s is the packet size in bytes
R is the round trip time in seconds R is the round trip time in seconds
p is the loss event rate, between 0 and 1.0, of the number of loss p is the loss event rate, between 0 and 1.0, of the number of loss
events as a fraction of the number of packets transmitted events as a fraction of the number of packets transmitted
t_RTO is the TCP retransmission timeout value in seconds t_RTO is the TCP retransmission timeout value in seconds
b is the number of packets acknowledged by a single TCP ACK b is the number of packets acknowledged by a single TCP ACK
@@ -47,9 +47,9 @@
which we can break down into: which we can break down into:
s s
X_calc = --------- X_calc = ---------
R * f(p) R * f(p)
where f(p) is given for 0 < p <= 1 by: where f(p) is given for 0 < p <= 1 by:
@@ -62,7 +62,7 @@
* the return result f(p) * the return result f(p)
The lookup table therefore actually tabulates the following function g(q): The lookup table therefore actually tabulates the following function g(q):
g(q) = 1000000 * f(q/1000000) g(q) = 1000000 * f(q/1000000)
Hence, when p <= 1, q must be less than or equal to 1000000. To achieve finer Hence, when p <= 1, q must be less than or equal to 1000000. To achieve finer
granularity for the practically more relevant case of small values of p (up to granularity for the practically more relevant case of small values of p (up to
@@ -628,7 +628,7 @@ u32 tfrc_calc_x(u16 s, u32 R, u32 p)
if (R == 0) { /* possible divide by zero */ if (R == 0) { /* possible divide by zero */
DCCP_CRIT("WARNING: RTT is 0, returning maximum X_calc."); DCCP_CRIT("WARNING: RTT is 0, returning maximum X_calc.");
return ~0U; return ~0U;
} }
if (p <= TFRC_CALC_X_SPLIT) { /* 0.0000 < p <= 0.05 */ if (p <= TFRC_CALC_X_SPLIT) { /* 0.0000 < p <= 0.05 */
if (p < TFRC_SMALLEST_P) { /* 0.0000 < p < 0.0001 */ if (p < TFRC_SMALLEST_P) { /* 0.0000 < p < 0.0001 */
@@ -638,7 +638,7 @@ u32 tfrc_calc_x(u16 s, u32 R, u32 p)
} else /* 0.0001 <= p <= 0.05 */ } else /* 0.0001 <= p <= 0.05 */
index = p/TFRC_SMALLEST_P - 1; index = p/TFRC_SMALLEST_P - 1;
f = tfrc_calc_x_lookup[index][1]; f = tfrc_calc_x_lookup[index][1];
} else { /* 0.05 < p <= 1.00 */ } else { /* 0.05 < p <= 1.00 */
index = p/(1000000/TFRC_CALC_X_ARRSIZE) - 1; index = p/(1000000/TFRC_CALC_X_ARRSIZE) - 1;
@@ -687,7 +687,7 @@ u32 tfrc_calc_x_reverse_lookup(u32 fvalue)
if (fvalue <= tfrc_calc_x_lookup[TFRC_CALC_X_ARRSIZE - 1][1]) { if (fvalue <= tfrc_calc_x_lookup[TFRC_CALC_X_ARRSIZE - 1][1]) {
index = tfrc_binsearch(fvalue, 1); index = tfrc_binsearch(fvalue, 1);
return (index + 1) * TFRC_CALC_X_SPLIT / TFRC_CALC_X_ARRSIZE; return (index + 1) * TFRC_CALC_X_SPLIT / TFRC_CALC_X_ARRSIZE;
} }
/* else ... it must be in the coarse-grained column */ /* else ... it must be in the coarse-grained column */
index = tfrc_binsearch(fvalue, 0); index = tfrc_binsearch(fvalue, 0);

View File

@@ -22,7 +22,7 @@
* DCCP - specific warning and debugging macros. * DCCP - specific warning and debugging macros.
*/ */
#define DCCP_WARN(fmt, a...) LIMIT_NETDEBUG(KERN_WARNING "%s: " fmt, \ #define DCCP_WARN(fmt, a...) LIMIT_NETDEBUG(KERN_WARNING "%s: " fmt, \
__FUNCTION__, ##a) __FUNCTION__, ##a)
#define DCCP_CRIT(fmt, a...) printk(KERN_CRIT fmt " at %s:%d/%s()\n", ##a, \ #define DCCP_CRIT(fmt, a...) printk(KERN_CRIT fmt " at %s:%d/%s()\n", ##a, \
__FILE__, __LINE__, __FUNCTION__) __FILE__, __LINE__, __FUNCTION__)
#define DCCP_BUG(a...) do { DCCP_CRIT("BUG: " a); dump_stack(); } while(0) #define DCCP_BUG(a...) do { DCCP_CRIT("BUG: " a); dump_stack(); } while(0)
@@ -34,7 +34,7 @@
#ifdef MODULE #ifdef MODULE
#define DCCP_PRINTK(enable, fmt, args...) do { if (enable) \ #define DCCP_PRINTK(enable, fmt, args...) do { if (enable) \
printk(fmt, ##args); \ printk(fmt, ##args); \
} while(0) } while(0)
#else #else
#define DCCP_PRINTK(enable, fmt, args...) printk(fmt, ##args) #define DCCP_PRINTK(enable, fmt, args...) printk(fmt, ##args)
#endif #endif

View File

@@ -480,8 +480,8 @@ void dccp_feat_clean(struct dccp_minisock *dmsk)
list_for_each_entry_safe(opt, next, &dmsk->dccpms_pending, list_for_each_entry_safe(opt, next, &dmsk->dccpms_pending,
dccpop_node) { dccpop_node) {
BUG_ON(opt->dccpop_val == NULL); BUG_ON(opt->dccpop_val == NULL);
kfree(opt->dccpop_val); kfree(opt->dccpop_val);
if (opt->dccpop_sc != NULL) { if (opt->dccpop_sc != NULL) {
BUG_ON(opt->dccpop_sc->dccpoc_val == NULL); BUG_ON(opt->dccpop_sc->dccpoc_val == NULL);
@@ -489,8 +489,8 @@ void dccp_feat_clean(struct dccp_minisock *dmsk)
kfree(opt->dccpop_sc); kfree(opt->dccpop_sc);
} }
kfree(opt); kfree(opt);
} }
INIT_LIST_HEAD(&dmsk->dccpms_pending); INIT_LIST_HEAD(&dmsk->dccpms_pending);
list_for_each_entry_safe(opt, next, &dmsk->dccpms_conf, dccpop_node) { list_for_each_entry_safe(opt, next, &dmsk->dccpms_conf, dccpop_node) {

View File

@@ -30,7 +30,7 @@ static inline int dccp_feat_is_reserved(const u8 feat)
{ {
return (feat > DCCPF_DATA_CHECKSUM && return (feat > DCCPF_DATA_CHECKSUM &&
feat < DCCPF_MIN_CCID_SPECIFIC) || feat < DCCPF_MIN_CCID_SPECIFIC) ||
feat == DCCPF_RESERVED; feat == DCCPF_RESERVED;
} }
/* feature negotiation knows only these four option types (RFC 4340, sec. 6) */ /* feature negotiation knows only these four option types (RFC 4340, sec. 6) */

View File

@@ -136,7 +136,7 @@ static int dccp_check_seqno(struct sock *sk, struct sk_buff *skb)
(unsigned long long) DCCP_SKB_CB(skb)->dccpd_seq, (unsigned long long) DCCP_SKB_CB(skb)->dccpd_seq,
(unsigned long long) dp->dccps_swh, (unsigned long long) dp->dccps_swh,
(DCCP_SKB_CB(skb)->dccpd_ack_seq == (DCCP_SKB_CB(skb)->dccpd_ack_seq ==
DCCP_PKT_WITHOUT_ACK_SEQ) ? "doesn't exist" : "exists", DCCP_PKT_WITHOUT_ACK_SEQ) ? "doesn't exist" : "exists",
(unsigned long long) lawl, (unsigned long long) lawl,
(unsigned long long) DCCP_SKB_CB(skb)->dccpd_ack_seq, (unsigned long long) DCCP_SKB_CB(skb)->dccpd_ack_seq,
(unsigned long long) dp->dccps_awh); (unsigned long long) dp->dccps_awh);
@@ -308,11 +308,11 @@ static int dccp_rcv_request_sent_state_process(struct sock *sk,
if (dccp_parse_options(sk, skb)) if (dccp_parse_options(sk, skb))
goto out_invalid_packet; goto out_invalid_packet;
if (dccp_msk(sk)->dccpms_send_ack_vector && if (dccp_msk(sk)->dccpms_send_ack_vector &&
dccp_ackvec_add(dp->dccps_hc_rx_ackvec, sk, dccp_ackvec_add(dp->dccps_hc_rx_ackvec, sk,
DCCP_SKB_CB(skb)->dccpd_seq, DCCP_SKB_CB(skb)->dccpd_seq,
DCCP_ACKVEC_STATE_RECEIVED)) DCCP_ACKVEC_STATE_RECEIVED))
goto out_invalid_packet; /* FIXME: change error code */ goto out_invalid_packet; /* FIXME: change error code */
dp->dccps_isr = DCCP_SKB_CB(skb)->dccpd_seq; dp->dccps_isr = DCCP_SKB_CB(skb)->dccpd_seq;
dccp_update_gsr(sk, dp->dccps_isr); dccp_update_gsr(sk, dp->dccps_isr);

View File

@@ -106,7 +106,7 @@ int dccp_v4_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len)
goto failure; goto failure;
err = ip_route_newports(&rt, IPPROTO_DCCP, inet->sport, inet->dport, err = ip_route_newports(&rt, IPPROTO_DCCP, inet->sport, inet->dport,
sk); sk);
if (err != 0) if (err != 0)
goto failure; goto failure;
@@ -157,7 +157,7 @@ static inline void dccp_do_pmtu_discovery(struct sock *sk,
/* We don't check in the destentry if pmtu discovery is forbidden /* We don't check in the destentry if pmtu discovery is forbidden
* on this route. We just assume that no packet_to_big packets * on this route. We just assume that no packet_to_big packets
* are send back when pmtu discovery is not active. * are send back when pmtu discovery is not active.
* There is a small race when the user changes this flag in the * There is a small race when the user changes this flag in the
* route, but I think that's acceptable. * route, but I think that's acceptable.
*/ */
if ((dst = __sk_dst_check(sk, 0)) == NULL) if ((dst = __sk_dst_check(sk, 0)) == NULL)

View File

@@ -734,7 +734,7 @@ static int dccp_v6_do_rcv(struct sock *sk, struct sk_buff *skb)
looks not very well thought. For now we latch looks not very well thought. For now we latch
options, received in the last packet, enqueued options, received in the last packet, enqueued
by tcp. Feel free to propose better solution. by tcp. Feel free to propose better solution.
--ANK (980728) --ANK (980728)
*/ */
if (np->rxopt.all) if (np->rxopt.all)
/* /*

View File

@@ -242,7 +242,7 @@ int dccp_parse_options(struct sock *sk, struct sk_buff *skb)
DCCP_CRIT("DCCP(%p): option %d(len=%d) not " DCCP_CRIT("DCCP(%p): option %d(len=%d) not "
"implemented, ignoring", sk, opt, len); "implemented, ignoring", sk, opt, len);
break; break;
} }
if (opt != DCCPO_MANDATORY) if (opt != DCCPO_MANDATORY)
mandatory = 0; mandatory = 0;
@@ -442,7 +442,7 @@ static int dccp_insert_option_timestamp_echo(struct sock *sk,
} }
static int dccp_insert_feat_opt(struct sk_buff *skb, u8 type, u8 feat, static int dccp_insert_feat_opt(struct sk_buff *skb, u8 type, u8 feat,
u8 *val, u8 len) u8 *val, u8 len)
{ {
u8 *to; u8 *to;

View File

@@ -478,7 +478,7 @@ static int do_dccp_setsockopt(struct sock *sk, int level, int optname,
err = -EINVAL; err = -EINVAL;
else else
err = dccp_setsockopt_change(sk, DCCPO_CHANGE_L, err = dccp_setsockopt_change(sk, DCCPO_CHANGE_L,
(struct dccp_so_feat __user *) (struct dccp_so_feat __user *)
optval); optval);
break; break;
case DCCP_SOCKOPT_CHANGE_R: case DCCP_SOCKOPT_CHANGE_R:

View File

@@ -60,7 +60,7 @@ static int dccp_write_timeout(struct sock *sk)
be far nicer to have all of the black holes fixed rather than fixing be far nicer to have all of the black holes fixed rather than fixing
all of the TCP implementations." all of the TCP implementations."
Golden words :-). Golden words :-).
*/ */
dst_negative_advice(&sk->sk_dst_cache); dst_negative_advice(&sk->sk_dst_cache);

View File

@@ -63,7 +63,7 @@ Version Kernel Date Author/Comments
Version 0.0.1 2.0.30 01-dic-97 Eduardo Marcelo Serrat Version 0.0.1 2.0.30 01-dic-97 Eduardo Marcelo Serrat
(emserrat@geocities.com) (emserrat@geocities.com)
First Development of DECnet Socket La- First Development of DECnet Socket La-
yer for Linux. Only supports outgoing yer for Linux. Only supports outgoing
connections. connections.
@@ -75,28 +75,28 @@ Version 0.0.2 2.1.105 20-jun-98 Patrick J. Caulfield
Version 0.0.3 2.1.106 25-jun-98 Eduardo Marcelo Serrat Version 0.0.3 2.1.106 25-jun-98 Eduardo Marcelo Serrat
(emserrat@geocities.com) (emserrat@geocities.com)
_ _
Added support for incoming connections Added support for incoming connections
so we can start developing server apps so we can start developing server apps
on Linux. on Linux.
- -
Module Support Module Support
Version 0.0.4 2.1.109 21-jul-98 Eduardo Marcelo Serrat Version 0.0.4 2.1.109 21-jul-98 Eduardo Marcelo Serrat
(emserrat@geocities.com) (emserrat@geocities.com)
_ _
Added support for X11R6.4. Now we can Added support for X11R6.4. Now we can
use DECnet transport for X on Linux!!! use DECnet transport for X on Linux!!!
- -
Version 0.0.5 2.1.110 01-aug-98 Eduardo Marcelo Serrat Version 0.0.5 2.1.110 01-aug-98 Eduardo Marcelo Serrat
(emserrat@geocities.com) (emserrat@geocities.com)
Removed bugs on flow control Removed bugs on flow control
Removed bugs on incoming accessdata Removed bugs on incoming accessdata
order order
- -
Version 0.0.6 2.1.110 07-aug-98 Eduardo Marcelo Serrat Version 0.0.6 2.1.110 07-aug-98 Eduardo Marcelo Serrat
dn_recvmsg fixes dn_recvmsg fixes
Patrick J. Caulfield Patrick J. Caulfield
dn_bind fixes dn_bind fixes
*******************************************************************************/ *******************************************************************************/
#include <linux/module.h> #include <linux/module.h>
@@ -400,7 +400,7 @@ struct sock *dn_sklist_find_listener(struct sockaddr_dn *addr)
sk = sk_head(&dn_wild_sk); sk = sk_head(&dn_wild_sk);
if (sk) { if (sk) {
if (sk->sk_state == TCP_LISTEN) if (sk->sk_state == TCP_LISTEN)
sock_hold(sk); sock_hold(sk);
else else
sk = NULL; sk = NULL;
@@ -500,7 +500,7 @@ static struct sock *dn_alloc_sock(struct socket *sock, gfp_t gfp)
scp->ackxmt_oth = 0; /* Last oth data ack'ed */ scp->ackxmt_oth = 0; /* Last oth data ack'ed */
scp->ackrcv_dat = 0; /* Highest data ack recv*/ scp->ackrcv_dat = 0; /* Highest data ack recv*/
scp->ackrcv_oth = 0; /* Last oth data ack rec*/ scp->ackrcv_oth = 0; /* Last oth data ack rec*/
scp->flowrem_sw = DN_SEND; scp->flowrem_sw = DN_SEND;
scp->flowloc_sw = DN_SEND; scp->flowloc_sw = DN_SEND;
scp->flowrem_dat = 0; scp->flowrem_dat = 0;
scp->flowrem_oth = 1; scp->flowrem_oth = 1;
@@ -713,7 +713,7 @@ dn_release(struct socket *sock)
sock_put(sk); sock_put(sk);
} }
return 0; return 0;
} }
static int dn_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len) static int dn_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
@@ -770,7 +770,7 @@ static int dn_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
} }
release_sock(sk); release_sock(sk);
return rv; return rv;
} }
@@ -997,20 +997,20 @@ static inline int dn_check_state(struct sock *sk, struct sockaddr_dn *addr, int
static void dn_access_copy(struct sk_buff *skb, struct accessdata_dn *acc) static void dn_access_copy(struct sk_buff *skb, struct accessdata_dn *acc)
{ {
unsigned char *ptr = skb->data; unsigned char *ptr = skb->data;
acc->acc_userl = *ptr++; acc->acc_userl = *ptr++;
memcpy(&acc->acc_user, ptr, acc->acc_userl); memcpy(&acc->acc_user, ptr, acc->acc_userl);
ptr += acc->acc_userl; ptr += acc->acc_userl;
acc->acc_passl = *ptr++; acc->acc_passl = *ptr++;
memcpy(&acc->acc_pass, ptr, acc->acc_passl); memcpy(&acc->acc_pass, ptr, acc->acc_passl);
ptr += acc->acc_passl; ptr += acc->acc_passl;
acc->acc_accl = *ptr++; acc->acc_accl = *ptr++;
memcpy(&acc->acc_acc, ptr, acc->acc_accl); memcpy(&acc->acc_acc, ptr, acc->acc_accl);
skb_pull(skb, acc->acc_accl + acc->acc_passl + acc->acc_userl + 3); skb_pull(skb, acc->acc_accl + acc->acc_passl + acc->acc_userl + 3);
} }
@@ -1071,7 +1071,7 @@ static int dn_accept(struct socket *sock, struct socket *newsock, int flags)
lock_sock(sk); lock_sock(sk);
if (sk->sk_state != TCP_LISTEN || DN_SK(sk)->state != DN_O) { if (sk->sk_state != TCP_LISTEN || DN_SK(sk)->state != DN_O) {
release_sock(sk); release_sock(sk);
return -EINVAL; return -EINVAL;
} }
@@ -1098,7 +1098,7 @@ static int dn_accept(struct socket *sock, struct socket *newsock, int flags)
dst_release(xchg(&newsk->sk_dst_cache, skb->dst)); dst_release(xchg(&newsk->sk_dst_cache, skb->dst));
skb->dst = NULL; skb->dst = NULL;
DN_SK(newsk)->state = DN_CR; DN_SK(newsk)->state = DN_CR;
DN_SK(newsk)->addrrem = cb->src_port; DN_SK(newsk)->addrrem = cb->src_port;
DN_SK(newsk)->services_rem = cb->services; DN_SK(newsk)->services_rem = cb->services;
DN_SK(newsk)->info_rem = cb->info; DN_SK(newsk)->info_rem = cb->info;
@@ -1154,15 +1154,15 @@ static int dn_accept(struct socket *sock, struct socket *newsock, int flags)
dn_send_conn_ack(newsk); dn_send_conn_ack(newsk);
/* /*
* Here we use sk->sk_allocation since although the conn conf is * Here we use sk->sk_allocation since although the conn conf is
* for the newsk, the context is the old socket. * for the newsk, the context is the old socket.
*/ */
if (DN_SK(newsk)->accept_mode == ACC_IMMED) if (DN_SK(newsk)->accept_mode == ACC_IMMED)
err = dn_confirm_accept(newsk, &timeo, err = dn_confirm_accept(newsk, &timeo,
sk->sk_allocation); sk->sk_allocation);
} }
release_sock(newsk); release_sock(newsk);
return err; return err;
} }
@@ -1180,7 +1180,7 @@ static int dn_getname(struct socket *sock, struct sockaddr *uaddr,int *uaddr_len
if ((sock->state != SS_CONNECTED && if ((sock->state != SS_CONNECTED &&
sock->state != SS_CONNECTING) && sock->state != SS_CONNECTING) &&
scp->accept_mode == ACC_IMMED) { scp->accept_mode == ACC_IMMED) {
release_sock(sk); release_sock(sk);
return -ENOTCONN; return -ENOTCONN;
} }
@@ -1191,7 +1191,7 @@ static int dn_getname(struct socket *sock, struct sockaddr *uaddr,int *uaddr_len
release_sock(sk); release_sock(sk);
return 0; return 0;
} }
@@ -1285,7 +1285,7 @@ static int dn_listen(struct socket *sock, int backlog)
out: out:
release_sock(sk); release_sock(sk);
return err; return err;
} }
@@ -1375,7 +1375,7 @@ static int __dn_setsockopt(struct socket *sock, int level,int optname, char __us
break; break;
case DSO_DISDATA: case DSO_DISDATA:
if (sock->state != SS_CONNECTED && scp->accept_mode == ACC_IMMED) if (sock->state != SS_CONNECTED && scp->accept_mode == ACC_IMMED)
return -ENOTCONN; return -ENOTCONN;
if (optlen != sizeof(struct optdata_dn)) if (optlen != sizeof(struct optdata_dn))
@@ -1588,7 +1588,7 @@ static int __dn_getsockopt(struct socket *sock, int level,int optname, char __us
case DSO_SEQPACKET: case DSO_SEQPACKET:
case DSO_CONACCEPT: case DSO_CONACCEPT:
case DSO_CONREJECT: case DSO_CONREJECT:
return -ENOPROTOOPT; return -ENOPROTOOPT;
case DSO_MAXWINDOW: case DSO_MAXWINDOW:
if (r_len > sizeof(unsigned long)) if (r_len > sizeof(unsigned long))
@@ -2214,7 +2214,7 @@ static void dn_printable_object(struct sockaddr_dn *dn, unsigned char *buf)
buf[i] = '.'; buf[i] = '.';
} }
buf[i] = 0; buf[i] = 0;
} }
} }
static char *dn_state2asc(unsigned char state) static char *dn_state2asc(unsigned char state)
@@ -2381,7 +2381,7 @@ static int __init decnet_init(void)
{ {
int rc; int rc;
printk(banner); printk(banner);
rc = proto_register(&dn_proto, 1); rc = proto_register(&dn_proto, 1);
if (rc != 0) if (rc != 0)

View File

@@ -884,39 +884,39 @@ last_chance:
static void dn_send_endnode_hello(struct net_device *dev, struct dn_ifaddr *ifa) static void dn_send_endnode_hello(struct net_device *dev, struct dn_ifaddr *ifa)
{ {
struct endnode_hello_message *msg; struct endnode_hello_message *msg;
struct sk_buff *skb = NULL; struct sk_buff *skb = NULL;
__le16 *pktlen; __le16 *pktlen;
struct dn_dev *dn_db = (struct dn_dev *)dev->dn_ptr; struct dn_dev *dn_db = (struct dn_dev *)dev->dn_ptr;
if ((skb = dn_alloc_skb(NULL, sizeof(*msg), GFP_ATOMIC)) == NULL) if ((skb = dn_alloc_skb(NULL, sizeof(*msg), GFP_ATOMIC)) == NULL)
return; return;
skb->dev = dev; skb->dev = dev;
msg = (struct endnode_hello_message *)skb_put(skb,sizeof(*msg)); msg = (struct endnode_hello_message *)skb_put(skb,sizeof(*msg));
msg->msgflg = 0x0D; msg->msgflg = 0x0D;
memcpy(msg->tiver, dn_eco_version, 3); memcpy(msg->tiver, dn_eco_version, 3);
dn_dn2eth(msg->id, ifa->ifa_local); dn_dn2eth(msg->id, ifa->ifa_local);
msg->iinfo = DN_RT_INFO_ENDN; msg->iinfo = DN_RT_INFO_ENDN;
msg->blksize = dn_htons(mtu2blksize(dev)); msg->blksize = dn_htons(mtu2blksize(dev));
msg->area = 0x00; msg->area = 0x00;
memset(msg->seed, 0, 8); memset(msg->seed, 0, 8);
memcpy(msg->neighbor, dn_hiord, ETH_ALEN); memcpy(msg->neighbor, dn_hiord, ETH_ALEN);
if (dn_db->router) { if (dn_db->router) {
struct dn_neigh *dn = (struct dn_neigh *)dn_db->router; struct dn_neigh *dn = (struct dn_neigh *)dn_db->router;
dn_dn2eth(msg->neighbor, dn->addr); dn_dn2eth(msg->neighbor, dn->addr);
} }
msg->timer = dn_htons((unsigned short)dn_db->parms.t3); msg->timer = dn_htons((unsigned short)dn_db->parms.t3);
msg->mpd = 0x00; msg->mpd = 0x00;
msg->datalen = 0x02; msg->datalen = 0x02;
memset(msg->data, 0xAA, 2); memset(msg->data, 0xAA, 2);
pktlen = (__le16 *)skb_push(skb,2); pktlen = (__le16 *)skb_push(skb,2);
*pktlen = dn_htons(skb->len - 2); *pktlen = dn_htons(skb->len - 2);
skb->nh.raw = skb->data; skb->nh.raw = skb->data;
@@ -1408,18 +1408,18 @@ static char *dn_type2asc(char type)
static int dn_dev_seq_show(struct seq_file *seq, void *v) static int dn_dev_seq_show(struct seq_file *seq, void *v)
{ {
if (v == SEQ_START_TOKEN) if (v == SEQ_START_TOKEN)
seq_puts(seq, "Name Flags T1 Timer1 T3 Timer3 BlkSize Pri State DevType Router Peer\n"); seq_puts(seq, "Name Flags T1 Timer1 T3 Timer3 BlkSize Pri State DevType Router Peer\n");
else { else {
struct net_device *dev = v; struct net_device *dev = v;
char peer_buf[DN_ASCBUF_LEN]; char peer_buf[DN_ASCBUF_LEN];
char router_buf[DN_ASCBUF_LEN]; char router_buf[DN_ASCBUF_LEN];
struct dn_dev *dn_db = dev->dn_ptr; struct dn_dev *dn_db = dev->dn_ptr;
seq_printf(seq, "%-8s %1s %04u %04u %04lu %04lu" seq_printf(seq, "%-8s %1s %04u %04u %04lu %04lu"
" %04hu %03d %02x %-10s %-7s %-7s\n", " %04hu %03d %02x %-10s %-7s %-7s\n",
dev->name ? dev->name : "???", dev->name ? dev->name : "???",
dn_type2asc(dn_db->parms.mode), dn_type2asc(dn_db->parms.mode),
0, 0, 0, 0,
dn_db->t3, dn_db->parms.t3, dn_db->t3, dn_db->parms.t3,
mtu2blksize(dev), mtu2blksize(dev),
dn_db->parms.priority, dn_db->parms.priority,
@@ -1476,17 +1476,17 @@ MODULE_PARM_DESC(addr, "The DECnet address of this machine: area,node");
void __init dn_dev_init(void) void __init dn_dev_init(void)
{ {
if (addr[0] > 63 || addr[0] < 0) { if (addr[0] > 63 || addr[0] < 0) {
printk(KERN_ERR "DECnet: Area must be between 0 and 63"); printk(KERN_ERR "DECnet: Area must be between 0 and 63");
return; return;
} }
if (addr[1] > 1023 || addr[1] < 0) { if (addr[1] > 1023 || addr[1] < 0) {
printk(KERN_ERR "DECnet: Node must be between 0 and 1023"); printk(KERN_ERR "DECnet: Node must be between 0 and 1023");
return; return;
} }
decnet_address = dn_htons((addr[0] << 10) | addr[1]); decnet_address = dn_htons((addr[0] << 10) | addr[1]);
dn_dev_devices_on(); dn_dev_devices_on();

View File

@@ -654,80 +654,80 @@ static int dn_fib_dnaddr_event(struct notifier_block *this, unsigned long event,
static int dn_fib_sync_down(__le16 local, struct net_device *dev, int force) static int dn_fib_sync_down(__le16 local, struct net_device *dev, int force)
{ {
int ret = 0; int ret = 0;
int scope = RT_SCOPE_NOWHERE; int scope = RT_SCOPE_NOWHERE;
if (force) if (force)
scope = -1; scope = -1;
for_fib_info() { for_fib_info() {
/* /*
* This makes no sense for DECnet.... we will almost * This makes no sense for DECnet.... we will almost
* certainly have more than one local address the same * certainly have more than one local address the same
* over all our interfaces. It needs thinking about * over all our interfaces. It needs thinking about
* some more. * some more.
*/ */
if (local && fi->fib_prefsrc == local) { if (local && fi->fib_prefsrc == local) {
fi->fib_flags |= RTNH_F_DEAD; fi->fib_flags |= RTNH_F_DEAD;
ret++; ret++;
} else if (dev && fi->fib_nhs) { } else if (dev && fi->fib_nhs) {
int dead = 0; int dead = 0;
change_nexthops(fi) { change_nexthops(fi) {
if (nh->nh_flags&RTNH_F_DEAD) if (nh->nh_flags&RTNH_F_DEAD)
dead++; dead++;
else if (nh->nh_dev == dev && else if (nh->nh_dev == dev &&
nh->nh_scope != scope) { nh->nh_scope != scope) {
spin_lock_bh(&dn_fib_multipath_lock); spin_lock_bh(&dn_fib_multipath_lock);
nh->nh_flags |= RTNH_F_DEAD; nh->nh_flags |= RTNH_F_DEAD;
fi->fib_power -= nh->nh_power; fi->fib_power -= nh->nh_power;
nh->nh_power = 0; nh->nh_power = 0;
spin_unlock_bh(&dn_fib_multipath_lock); spin_unlock_bh(&dn_fib_multipath_lock);
dead++; dead++;
} }
} endfor_nexthops(fi) } endfor_nexthops(fi)
if (dead == fi->fib_nhs) { if (dead == fi->fib_nhs) {
fi->fib_flags |= RTNH_F_DEAD; fi->fib_flags |= RTNH_F_DEAD;
ret++; ret++;
} }
} }
} endfor_fib_info(); } endfor_fib_info();
return ret; return ret;
} }
static int dn_fib_sync_up(struct net_device *dev) static int dn_fib_sync_up(struct net_device *dev)
{ {
int ret = 0; int ret = 0;
if (!(dev->flags&IFF_UP)) if (!(dev->flags&IFF_UP))
return 0; return 0;
for_fib_info() { for_fib_info() {
int alive = 0; int alive = 0;
change_nexthops(fi) { change_nexthops(fi) {
if (!(nh->nh_flags&RTNH_F_DEAD)) { if (!(nh->nh_flags&RTNH_F_DEAD)) {
alive++; alive++;
continue; continue;
} }
if (nh->nh_dev == NULL || !(nh->nh_dev->flags&IFF_UP)) if (nh->nh_dev == NULL || !(nh->nh_dev->flags&IFF_UP))
continue; continue;
if (nh->nh_dev != dev || dev->dn_ptr == NULL) if (nh->nh_dev != dev || dev->dn_ptr == NULL)
continue; continue;
alive++; alive++;
spin_lock_bh(&dn_fib_multipath_lock); spin_lock_bh(&dn_fib_multipath_lock);
nh->nh_power = 0; nh->nh_power = 0;
nh->nh_flags &= ~RTNH_F_DEAD; nh->nh_flags &= ~RTNH_F_DEAD;
spin_unlock_bh(&dn_fib_multipath_lock); spin_unlock_bh(&dn_fib_multipath_lock);
} endfor_nexthops(fi); } endfor_nexthops(fi);
if (alive > 0) { if (alive > 0) {
fi->fib_flags &= ~RTNH_F_DEAD; fi->fib_flags &= ~RTNH_F_DEAD;
ret++; ret++;
} }
} endfor_fib_info(); } endfor_fib_info();
return ret; return ret;
} }
static struct notifier_block dn_fib_dnaddr_notifier = { static struct notifier_block dn_fib_dnaddr_notifier = {

View File

@@ -277,19 +277,19 @@ static int dn_short_output(struct sk_buff *skb)
struct dn_skb_cb *cb = DN_SKB_CB(skb); struct dn_skb_cb *cb = DN_SKB_CB(skb);
if (skb_headroom(skb) < headroom) { if (skb_headroom(skb) < headroom) {
struct sk_buff *skb2 = skb_realloc_headroom(skb, headroom); struct sk_buff *skb2 = skb_realloc_headroom(skb, headroom);
if (skb2 == NULL) { if (skb2 == NULL) {
if (net_ratelimit()) if (net_ratelimit())
printk(KERN_CRIT "dn_short_output: no memory\n"); printk(KERN_CRIT "dn_short_output: no memory\n");
kfree_skb(skb); kfree_skb(skb);
return -ENOBUFS; return -ENOBUFS;
} }
kfree_skb(skb); kfree_skb(skb);
skb = skb2; skb = skb2;
if (net_ratelimit()) if (net_ratelimit())
printk(KERN_INFO "dn_short_output: Increasing headroom\n"); printk(KERN_INFO "dn_short_output: Increasing headroom\n");
} }
data = skb_push(skb, sizeof(struct dn_short_packet) + 2); data = skb_push(skb, sizeof(struct dn_short_packet) + 2);
*((__le16 *)data) = dn_htons(skb->len - 2); *((__le16 *)data) = dn_htons(skb->len - 2);

View File

@@ -349,9 +349,9 @@ static void dn_nsp_conn_conf(struct sock *sk, struct sk_buff *skb)
if ((scp->state == DN_CI) || (scp->state == DN_CD)) { if ((scp->state == DN_CI) || (scp->state == DN_CD)) {
scp->persist = 0; scp->persist = 0;
scp->addrrem = cb->src_port; scp->addrrem = cb->src_port;
sk->sk_state = TCP_ESTABLISHED; sk->sk_state = TCP_ESTABLISHED;
scp->state = DN_RUN; scp->state = DN_RUN;
scp->services_rem = cb->services; scp->services_rem = cb->services;
scp->info_rem = cb->info; scp->info_rem = cb->info;
scp->segsize_rem = cb->segsize; scp->segsize_rem = cb->segsize;
@@ -366,13 +366,13 @@ static void dn_nsp_conn_conf(struct sock *sk, struct sk_buff *skb)
memcpy(scp->conndata_in.opt_data, skb->data + 1, dlen); memcpy(scp->conndata_in.opt_data, skb->data + 1, dlen);
} }
} }
dn_nsp_send_link(sk, DN_NOCHANGE, 0); dn_nsp_send_link(sk, DN_NOCHANGE, 0);
if (!sock_flag(sk, SOCK_DEAD)) if (!sock_flag(sk, SOCK_DEAD))
sk->sk_state_change(sk); sk->sk_state_change(sk);
} }
out: out:
kfree_skb(skb); kfree_skb(skb);
} }
static void dn_nsp_conn_ack(struct sock *sk, struct sk_buff *skb) static void dn_nsp_conn_ack(struct sock *sk, struct sk_buff *skb)
@@ -530,7 +530,7 @@ static void dn_nsp_linkservice(struct sock *sk, struct sk_buff *skb)
switch(lsflags & 0x04) { /* FCVAL INT */ switch(lsflags & 0x04) { /* FCVAL INT */
case 0x00: /* Normal Request */ case 0x00: /* Normal Request */
switch(lsflags & 0x03) { /* FCVAL MOD */ switch(lsflags & 0x03) { /* FCVAL MOD */
case 0x00: /* Request count */ case 0x00: /* Request count */
if (fcval < 0) { if (fcval < 0) {
unsigned char p_fcval = -fcval; unsigned char p_fcval = -fcval;
if ((scp->flowrem_dat > p_fcval) && if ((scp->flowrem_dat > p_fcval) &&
@@ -541,7 +541,7 @@ static void dn_nsp_linkservice(struct sock *sk, struct sk_buff *skb)
scp->flowrem_dat += fcval; scp->flowrem_dat += fcval;
wake_up = 1; wake_up = 1;
} }
break; break;
case 0x01: /* Stop outgoing data */ case 0x01: /* Stop outgoing data */
scp->flowrem_sw = DN_DONTSEND; scp->flowrem_sw = DN_DONTSEND;
break; break;
@@ -557,10 +557,10 @@ static void dn_nsp_linkservice(struct sock *sk, struct sk_buff *skb)
wake_up = 1; wake_up = 1;
} }
break; break;
} }
if (wake_up && !sock_flag(sk, SOCK_DEAD)) if (wake_up && !sock_flag(sk, SOCK_DEAD))
sk->sk_state_change(sk); sk->sk_state_change(sk);
} }
dn_nsp_send_oth_ack(sk); dn_nsp_send_oth_ack(sk);
@@ -577,27 +577,27 @@ static __inline__ int dn_queue_skb(struct sock *sk, struct sk_buff *skb, int sig
{ {
int err; int err;
/* Cast skb->rcvbuf to unsigned... It's pointless, but reduces /* Cast skb->rcvbuf to unsigned... It's pointless, but reduces
number of warnings when compiling with -W --ANK number of warnings when compiling with -W --ANK
*/ */
if (atomic_read(&sk->sk_rmem_alloc) + skb->truesize >= if (atomic_read(&sk->sk_rmem_alloc) + skb->truesize >=
(unsigned)sk->sk_rcvbuf) { (unsigned)sk->sk_rcvbuf) {
err = -ENOMEM; err = -ENOMEM;
goto out; goto out;
} }
err = sk_filter(sk, skb); err = sk_filter(sk, skb);
if (err) if (err)
goto out; goto out;
skb_set_owner_r(skb, sk); skb_set_owner_r(skb, sk);
skb_queue_tail(queue, skb); skb_queue_tail(queue, skb);
/* This code only runs from BH or BH protected context. /* This code only runs from BH or BH protected context.
* Therefore the plain read_lock is ok here. -DaveM * Therefore the plain read_lock is ok here. -DaveM
*/ */
read_lock(&sk->sk_callback_lock); read_lock(&sk->sk_callback_lock);
if (!sock_flag(sk, SOCK_DEAD)) { if (!sock_flag(sk, SOCK_DEAD)) {
struct socket *sock = sk->sk_socket; struct socket *sock = sk->sk_socket;
wake_up_interruptible(sk->sk_sleep); wake_up_interruptible(sk->sk_sleep);
if (sock && sock->fasync_list && if (sock && sock->fasync_list &&
@@ -607,7 +607,7 @@ static __inline__ int dn_queue_skb(struct sock *sk, struct sk_buff *skb, int sig
} }
read_unlock(&sk->sk_callback_lock); read_unlock(&sk->sk_callback_lock);
out: out:
return err; return err;
} }
static void dn_nsp_otherdata(struct sock *sk, struct sk_buff *skb) static void dn_nsp_otherdata(struct sock *sk, struct sk_buff *skb)
@@ -652,16 +652,16 @@ static void dn_nsp_data(struct sock *sk, struct sk_buff *skb)
skb_pull(skb, 2); skb_pull(skb, 2);
if (seq_next(scp->numdat_rcv, segnum)) { if (seq_next(scp->numdat_rcv, segnum)) {
if (dn_queue_skb(sk, skb, SIGIO, &sk->sk_receive_queue) == 0) { if (dn_queue_skb(sk, skb, SIGIO, &sk->sk_receive_queue) == 0) {
seq_add(&scp->numdat_rcv, 1); seq_add(&scp->numdat_rcv, 1);
queued = 1; queued = 1;
} }
if ((scp->flowloc_sw == DN_SEND) && dn_congested(sk)) { if ((scp->flowloc_sw == DN_SEND) && dn_congested(sk)) {
scp->flowloc_sw = DN_DONTSEND; scp->flowloc_sw = DN_DONTSEND;
dn_nsp_send_link(sk, DN_DONTSEND, 0); dn_nsp_send_link(sk, DN_DONTSEND, 0);
} }
} }
dn_nsp_send_data_ack(sk); dn_nsp_send_data_ack(sk);
out: out:

View File

@@ -486,13 +486,13 @@ void dn_send_conn_ack (struct sock *sk)
{ {
struct dn_scp *scp = DN_SK(sk); struct dn_scp *scp = DN_SK(sk);
struct sk_buff *skb = NULL; struct sk_buff *skb = NULL;
struct nsp_conn_ack_msg *msg; struct nsp_conn_ack_msg *msg;
if ((skb = dn_alloc_skb(sk, 3, sk->sk_allocation)) == NULL) if ((skb = dn_alloc_skb(sk, 3, sk->sk_allocation)) == NULL)
return; return;
msg = (struct nsp_conn_ack_msg *)skb_put(skb, 3); msg = (struct nsp_conn_ack_msg *)skb_put(skb, 3);
msg->msgflg = 0x24; msg->msgflg = 0x24;
msg->dstaddr = scp->addrrem; msg->dstaddr = scp->addrrem;
dn_nsp_send(skb); dn_nsp_send(skb);
@@ -523,19 +523,19 @@ void dn_send_conn_conf(struct sock *sk, gfp_t gfp)
{ {
struct dn_scp *scp = DN_SK(sk); struct dn_scp *scp = DN_SK(sk);
struct sk_buff *skb = NULL; struct sk_buff *skb = NULL;
struct nsp_conn_init_msg *msg; struct nsp_conn_init_msg *msg;
__u8 len = (__u8)dn_ntohs(scp->conndata_out.opt_optl); __u8 len = (__u8)dn_ntohs(scp->conndata_out.opt_optl);
if ((skb = dn_alloc_skb(sk, 50 + len, gfp)) == NULL) if ((skb = dn_alloc_skb(sk, 50 + len, gfp)) == NULL)
return; return;
msg = (struct nsp_conn_init_msg *)skb_put(skb, sizeof(*msg)); msg = (struct nsp_conn_init_msg *)skb_put(skb, sizeof(*msg));
msg->msgflg = 0x28; msg->msgflg = 0x28;
msg->dstaddr = scp->addrrem; msg->dstaddr = scp->addrrem;
msg->srcaddr = scp->addrloc; msg->srcaddr = scp->addrloc;
msg->services = scp->services_loc; msg->services = scp->services_loc;
msg->info = scp->info_loc; msg->info = scp->info_loc;
msg->segsize = dn_htons(scp->segsize_loc); msg->segsize = dn_htons(scp->segsize_loc);
*skb_put(skb,1) = len; *skb_put(skb,1) = len;

View File

@@ -167,11 +167,11 @@ static void dn_dst_check_expire(unsigned long dummy)
while((rt=*rtp) != NULL) { while((rt=*rtp) != NULL) {
if (atomic_read(&rt->u.dst.__refcnt) || if (atomic_read(&rt->u.dst.__refcnt) ||
(now - rt->u.dst.lastuse) < expire) { (now - rt->u.dst.lastuse) < expire) {
rtp = &rt->u.rt_next; rtp = &rt->u.dst.dn_next;
continue; continue;
} }
*rtp = rt->u.rt_next; *rtp = rt->u.dst.dn_next;
rt->u.rt_next = NULL; rt->u.dst.dn_next = NULL;
dnrt_free(rt); dnrt_free(rt);
} }
spin_unlock(&dn_rt_hash_table[i].lock); spin_unlock(&dn_rt_hash_table[i].lock);
@@ -198,11 +198,11 @@ static int dn_dst_gc(void)
while((rt=*rtp) != NULL) { while((rt=*rtp) != NULL) {
if (atomic_read(&rt->u.dst.__refcnt) || if (atomic_read(&rt->u.dst.__refcnt) ||
(now - rt->u.dst.lastuse) < expire) { (now - rt->u.dst.lastuse) < expire) {
rtp = &rt->u.rt_next; rtp = &rt->u.dst.dn_next;
continue; continue;
} }
*rtp = rt->u.rt_next; *rtp = rt->u.dst.dn_next;
rt->u.rt_next = NULL; rt->u.dst.dn_next = NULL;
dnrt_drop(rt); dnrt_drop(rt);
break; break;
} }
@@ -286,8 +286,8 @@ static int dn_insert_route(struct dn_route *rt, unsigned hash, struct dn_route *
while((rth = *rthp) != NULL) { while((rth = *rthp) != NULL) {
if (compare_keys(&rth->fl, &rt->fl)) { if (compare_keys(&rth->fl, &rt->fl)) {
/* Put it first */ /* Put it first */
*rthp = rth->u.rt_next; *rthp = rth->u.dst.dn_next;
rcu_assign_pointer(rth->u.rt_next, rcu_assign_pointer(rth->u.dst.dn_next,
dn_rt_hash_table[hash].chain); dn_rt_hash_table[hash].chain);
rcu_assign_pointer(dn_rt_hash_table[hash].chain, rth); rcu_assign_pointer(dn_rt_hash_table[hash].chain, rth);
@@ -300,10 +300,10 @@ static int dn_insert_route(struct dn_route *rt, unsigned hash, struct dn_route *
*rp = rth; *rp = rth;
return 0; return 0;
} }
rthp = &rth->u.rt_next; rthp = &rth->u.dst.dn_next;
} }
rcu_assign_pointer(rt->u.rt_next, dn_rt_hash_table[hash].chain); rcu_assign_pointer(rt->u.dst.dn_next, dn_rt_hash_table[hash].chain);
rcu_assign_pointer(dn_rt_hash_table[hash].chain, rt); rcu_assign_pointer(dn_rt_hash_table[hash].chain, rt);
dst_hold(&rt->u.dst); dst_hold(&rt->u.dst);
@@ -326,8 +326,8 @@ void dn_run_flush(unsigned long dummy)
goto nothing_to_declare; goto nothing_to_declare;
for(; rt; rt=next) { for(; rt; rt=next) {
next = rt->u.rt_next; next = rt->u.dst.dn_next;
rt->u.rt_next = NULL; rt->u.dst.dn_next = NULL;
dst_free((struct dst_entry *)rt); dst_free((struct dst_entry *)rt);
} }
@@ -506,23 +506,23 @@ static int dn_route_rx_long(struct sk_buff *skb)
skb_pull(skb, 20); skb_pull(skb, 20);
skb->h.raw = skb->data; skb->h.raw = skb->data;
/* Destination info */ /* Destination info */
ptr += 2; ptr += 2;
cb->dst = dn_eth2dn(ptr); cb->dst = dn_eth2dn(ptr);
if (memcmp(ptr, dn_hiord_addr, 4) != 0) if (memcmp(ptr, dn_hiord_addr, 4) != 0)
goto drop_it; goto drop_it;
ptr += 6; ptr += 6;
/* Source info */ /* Source info */
ptr += 2; ptr += 2;
cb->src = dn_eth2dn(ptr); cb->src = dn_eth2dn(ptr);
if (memcmp(ptr, dn_hiord_addr, 4) != 0) if (memcmp(ptr, dn_hiord_addr, 4) != 0)
goto drop_it; goto drop_it;
ptr += 6; ptr += 6;
/* Other junk */ /* Other junk */
ptr++; ptr++;
cb->hops = *ptr++; /* Visit Count */ cb->hops = *ptr++; /* Visit Count */
return NF_HOOK(PF_DECnet, NF_DN_PRE_ROUTING, skb, skb->dev, NULL, dn_route_rx_packet); return NF_HOOK(PF_DECnet, NF_DN_PRE_ROUTING, skb, skb->dev, NULL, dn_route_rx_packet);
@@ -545,16 +545,16 @@ static int dn_route_rx_short(struct sk_buff *skb)
skb->h.raw = skb->data; skb->h.raw = skb->data;
cb->dst = *(__le16 *)ptr; cb->dst = *(__le16 *)ptr;
ptr += 2; ptr += 2;
cb->src = *(__le16 *)ptr; cb->src = *(__le16 *)ptr;
ptr += 2; ptr += 2;
cb->hops = *ptr & 0x3f; cb->hops = *ptr & 0x3f;
return NF_HOOK(PF_DECnet, NF_DN_PRE_ROUTING, skb, skb->dev, NULL, dn_route_rx_packet); return NF_HOOK(PF_DECnet, NF_DN_PRE_ROUTING, skb, skb->dev, NULL, dn_route_rx_packet);
drop_it: drop_it:
kfree_skb(skb); kfree_skb(skb);
return NET_RX_DROP; return NET_RX_DROP;
} }
static int dn_route_discard(struct sk_buff *skb) static int dn_route_discard(struct sk_buff *skb)
@@ -631,15 +631,15 @@ int dn_route_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type
(int)flags, (dev) ? dev->name : "???", len, skb->len, (int)flags, (dev) ? dev->name : "???", len, skb->len,
padlen); padlen);
if (flags & DN_RT_PKT_CNTL) { if (flags & DN_RT_PKT_CNTL) {
if (unlikely(skb_linearize(skb))) if (unlikely(skb_linearize(skb)))
goto dump_it; goto dump_it;
switch(flags & DN_RT_CNTL_MSK) { switch(flags & DN_RT_CNTL_MSK) {
case DN_RT_PKT_INIT: case DN_RT_PKT_INIT:
dn_dev_init_pkt(skb); dn_dev_init_pkt(skb);
break; break;
case DN_RT_PKT_VERI: case DN_RT_PKT_VERI:
dn_dev_veri_pkt(skb); dn_dev_veri_pkt(skb);
break; break;
} }
@@ -648,31 +648,31 @@ int dn_route_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type
goto dump_it; goto dump_it;
switch(flags & DN_RT_CNTL_MSK) { switch(flags & DN_RT_CNTL_MSK) {
case DN_RT_PKT_HELO: case DN_RT_PKT_HELO:
return NF_HOOK(PF_DECnet, NF_DN_HELLO, skb, skb->dev, NULL, dn_route_ptp_hello); return NF_HOOK(PF_DECnet, NF_DN_HELLO, skb, skb->dev, NULL, dn_route_ptp_hello);
case DN_RT_PKT_L1RT: case DN_RT_PKT_L1RT:
case DN_RT_PKT_L2RT: case DN_RT_PKT_L2RT:
return NF_HOOK(PF_DECnet, NF_DN_ROUTE, skb, skb->dev, NULL, dn_route_discard); return NF_HOOK(PF_DECnet, NF_DN_ROUTE, skb, skb->dev, NULL, dn_route_discard);
case DN_RT_PKT_ERTH: case DN_RT_PKT_ERTH:
return NF_HOOK(PF_DECnet, NF_DN_HELLO, skb, skb->dev, NULL, dn_neigh_router_hello); return NF_HOOK(PF_DECnet, NF_DN_HELLO, skb, skb->dev, NULL, dn_neigh_router_hello);
case DN_RT_PKT_EEDH: case DN_RT_PKT_EEDH:
return NF_HOOK(PF_DECnet, NF_DN_HELLO, skb, skb->dev, NULL, dn_neigh_endnode_hello); return NF_HOOK(PF_DECnet, NF_DN_HELLO, skb, skb->dev, NULL, dn_neigh_endnode_hello);
} }
} else { } else {
if (dn->parms.state != DN_DEV_S_RU) if (dn->parms.state != DN_DEV_S_RU)
goto dump_it; goto dump_it;
skb_pull(skb, 1); /* Pull flags */ skb_pull(skb, 1); /* Pull flags */
switch(flags & DN_RT_PKT_MSK) { switch(flags & DN_RT_PKT_MSK) {
case DN_RT_PKT_LONG: case DN_RT_PKT_LONG:
return dn_route_rx_long(skb); return dn_route_rx_long(skb);
case DN_RT_PKT_SHORT: case DN_RT_PKT_SHORT:
return dn_route_rx_short(skb); return dn_route_rx_short(skb);
} }
} }
dump_it: dump_it:
kfree_skb(skb); kfree_skb(skb);
@@ -816,7 +816,7 @@ static int dn_rt_set_next_hop(struct dn_route *rt, struct dn_fib_res *res)
} }
if (rt->u.dst.metrics[RTAX_MTU-1] == 0 || if (rt->u.dst.metrics[RTAX_MTU-1] == 0 ||
rt->u.dst.metrics[RTAX_MTU-1] > rt->u.dst.dev->mtu) rt->u.dst.metrics[RTAX_MTU-1] > rt->u.dst.dev->mtu)
rt->u.dst.metrics[RTAX_MTU-1] = rt->u.dst.dev->mtu; rt->u.dst.metrics[RTAX_MTU-1] = rt->u.dst.dev->mtu;
mss = dn_mss_from_pmtu(dev, dst_mtu(&rt->u.dst)); mss = dn_mss_from_pmtu(dev, dst_mtu(&rt->u.dst));
if (rt->u.dst.metrics[RTAX_ADVMSS-1] == 0 || if (rt->u.dst.metrics[RTAX_ADVMSS-1] == 0 ||
@@ -899,7 +899,7 @@ static int dn_route_output_slow(struct dst_entry **pprt, const struct flowi *old
"dn_route_output_slow: dst=%04x src=%04x mark=%d" "dn_route_output_slow: dst=%04x src=%04x mark=%d"
" iif=%d oif=%d\n", dn_ntohs(oldflp->fld_dst), " iif=%d oif=%d\n", dn_ntohs(oldflp->fld_dst),
dn_ntohs(oldflp->fld_src), dn_ntohs(oldflp->fld_src),
oldflp->mark, loopback_dev.ifindex, oldflp->oif); oldflp->mark, loopback_dev.ifindex, oldflp->oif);
/* If we have an output interface, verify its a DECnet device */ /* If we have an output interface, verify its a DECnet device */
if (oldflp->oif) { if (oldflp->oif) {
@@ -982,7 +982,7 @@ source_ok:
if (err != -ESRCH) if (err != -ESRCH)
goto out; goto out;
/* /*
* Here the fallback is basically the standard algorithm for * Here the fallback is basically the standard algorithm for
* routing in endnodes which is described in the DECnet routing * routing in endnodes which is described in the DECnet routing
* docs * docs
* *
@@ -1144,8 +1144,8 @@ out:
return err; return err;
e_addr: e_addr:
err = -EADDRNOTAVAIL; err = -EADDRNOTAVAIL;
goto done; goto done;
e_inval: e_inval:
err = -EINVAL; err = -EINVAL;
goto done; goto done;
@@ -1169,7 +1169,7 @@ static int __dn_route_output_key(struct dst_entry **pprt, const struct flowi *fl
if (!(flags & MSG_TRYHARD)) { if (!(flags & MSG_TRYHARD)) {
rcu_read_lock_bh(); rcu_read_lock_bh();
for(rt = rcu_dereference(dn_rt_hash_table[hash].chain); rt; for(rt = rcu_dereference(dn_rt_hash_table[hash].chain); rt;
rt = rcu_dereference(rt->u.rt_next)) { rt = rcu_dereference(rt->u.dst.dn_next)) {
if ((flp->fld_dst == rt->fl.fld_dst) && if ((flp->fld_dst == rt->fl.fld_dst) &&
(flp->fld_src == rt->fl.fld_src) && (flp->fld_src == rt->fl.fld_src) &&
(flp->mark == rt->fl.mark) && (flp->mark == rt->fl.mark) &&
@@ -1443,9 +1443,9 @@ int dn_route_input(struct sk_buff *skb)
rcu_read_lock(); rcu_read_lock();
for(rt = rcu_dereference(dn_rt_hash_table[hash].chain); rt != NULL; for(rt = rcu_dereference(dn_rt_hash_table[hash].chain); rt != NULL;
rt = rcu_dereference(rt->u.rt_next)) { rt = rcu_dereference(rt->u.dst.dn_next)) {
if ((rt->fl.fld_src == cb->src) && if ((rt->fl.fld_src == cb->src) &&
(rt->fl.fld_dst == cb->dst) && (rt->fl.fld_dst == cb->dst) &&
(rt->fl.oif == 0) && (rt->fl.oif == 0) &&
(rt->fl.mark == skb->mark) && (rt->fl.mark == skb->mark) &&
(rt->fl.iif == cb->iif)) { (rt->fl.iif == cb->iif)) {
@@ -1514,8 +1514,8 @@ static int dn_rt_fill_info(struct sk_buff *skb, u32 pid, u32 seq,
nlmsg_failure: nlmsg_failure:
rtattr_failure: rtattr_failure:
skb_trim(skb, b - skb->data); skb_trim(skb, b - skb->data);
return -1; return -1;
} }
/* /*
@@ -1627,7 +1627,7 @@ int dn_cache_dump(struct sk_buff *skb, struct netlink_callback *cb)
rcu_read_lock_bh(); rcu_read_lock_bh();
for(rt = rcu_dereference(dn_rt_hash_table[h].chain), idx = 0; for(rt = rcu_dereference(dn_rt_hash_table[h].chain), idx = 0;
rt; rt;
rt = rcu_dereference(rt->u.rt_next), idx++) { rt = rcu_dereference(rt->u.dst.dn_next), idx++) {
if (idx < s_idx) if (idx < s_idx)
continue; continue;
skb->dst = dst_clone(&rt->u.dst); skb->dst = dst_clone(&rt->u.dst);
@@ -1673,7 +1673,7 @@ static struct dn_route *dn_rt_cache_get_next(struct seq_file *seq, struct dn_rou
{ {
struct dn_rt_cache_iter_state *s = rcu_dereference(seq->private); struct dn_rt_cache_iter_state *s = rcu_dereference(seq->private);
rt = rt->u.rt_next; rt = rt->u.dst.dn_next;
while(!rt) { while(!rt) {
rcu_read_unlock_bh(); rcu_read_unlock_bh();
if (--s->bucket < 0) if (--s->bucket < 0)
@@ -1778,25 +1778,25 @@ void __init dn_route_init(void)
for(order = 0; (1UL << order) < goal; order++) for(order = 0; (1UL << order) < goal; order++)
/* NOTHING */; /* NOTHING */;
/* /*
* Only want 1024 entries max, since the table is very, very unlikely * Only want 1024 entries max, since the table is very, very unlikely
* to be larger than that. * to be larger than that.
*/ */
while(order && ((((1UL << order) * PAGE_SIZE) / while(order && ((((1UL << order) * PAGE_SIZE) /
sizeof(struct dn_rt_hash_bucket)) >= 2048)) sizeof(struct dn_rt_hash_bucket)) >= 2048))
order--; order--;
do { do {
dn_rt_hash_mask = (1UL << order) * PAGE_SIZE / dn_rt_hash_mask = (1UL << order) * PAGE_SIZE /
sizeof(struct dn_rt_hash_bucket); sizeof(struct dn_rt_hash_bucket);
while(dn_rt_hash_mask & (dn_rt_hash_mask - 1)) while(dn_rt_hash_mask & (dn_rt_hash_mask - 1))
dn_rt_hash_mask--; dn_rt_hash_mask--;
dn_rt_hash_table = (struct dn_rt_hash_bucket *) dn_rt_hash_table = (struct dn_rt_hash_bucket *)
__get_free_pages(GFP_ATOMIC, order); __get_free_pages(GFP_ATOMIC, order);
} while (dn_rt_hash_table == NULL && --order > 0); } while (dn_rt_hash_table == NULL && --order > 0);
if (!dn_rt_hash_table) if (!dn_rt_hash_table)
panic("Failed to allocate DECnet route cache hash table\n"); panic("Failed to allocate DECnet route cache hash table\n");
printk(KERN_INFO printk(KERN_INFO
"DECnet: Routing cache hash table of %u buckets, %ldKbytes\n", "DECnet: Routing cache hash table of %u buckets, %ldKbytes\n",
@@ -1804,12 +1804,12 @@ void __init dn_route_init(void)
(long)(dn_rt_hash_mask*sizeof(struct dn_rt_hash_bucket))/1024); (long)(dn_rt_hash_mask*sizeof(struct dn_rt_hash_bucket))/1024);
dn_rt_hash_mask--; dn_rt_hash_mask--;
for(i = 0; i <= dn_rt_hash_mask; i++) { for(i = 0; i <= dn_rt_hash_mask; i++) {
spin_lock_init(&dn_rt_hash_table[i].lock); spin_lock_init(&dn_rt_hash_table[i].lock);
dn_rt_hash_table[i].chain = NULL; dn_rt_hash_table[i].chain = NULL;
} }
dn_dst_ops.gc_thresh = (dn_rt_hash_mask + 1); dn_dst_ops.gc_thresh = (dn_rt_hash_mask + 1);
proc_net_fops_create("decnet_cache", S_IRUGO, &dn_rt_cache_seq_fops); proc_net_fops_create("decnet_cache", S_IRUGO, &dn_rt_cache_seq_fops);
} }

View File

@@ -60,7 +60,7 @@ struct dn_hash
#define dz_prefix(key,dz) ((key).datum) #define dz_prefix(key,dz) ((key).datum)
#define for_nexthops(fi) { int nhsel; const struct dn_fib_nh *nh;\ #define for_nexthops(fi) { int nhsel; const struct dn_fib_nh *nh;\
for(nhsel = 0, nh = (fi)->fib_nh; nhsel < (fi)->fib_nhs; nh++, nhsel++) for(nhsel = 0, nh = (fi)->fib_nh; nhsel < (fi)->fib_nhs; nh++, nhsel++)
#define endfor_nexthops(fi) } #define endfor_nexthops(fi) }
@@ -290,82 +290,82 @@ static inline size_t dn_fib_nlmsg_size(struct dn_fib_info *fi)
} }
static int dn_fib_dump_info(struct sk_buff *skb, u32 pid, u32 seq, int event, static int dn_fib_dump_info(struct sk_buff *skb, u32 pid, u32 seq, int event,
u32 tb_id, u8 type, u8 scope, void *dst, int dst_len, u32 tb_id, u8 type, u8 scope, void *dst, int dst_len,
struct dn_fib_info *fi, unsigned int flags) struct dn_fib_info *fi, unsigned int flags)
{ {
struct rtmsg *rtm; struct rtmsg *rtm;
struct nlmsghdr *nlh; struct nlmsghdr *nlh;
unsigned char *b = skb->tail; unsigned char *b = skb->tail;
nlh = NLMSG_NEW(skb, pid, seq, event, sizeof(*rtm), flags); nlh = NLMSG_NEW(skb, pid, seq, event, sizeof(*rtm), flags);
rtm = NLMSG_DATA(nlh); rtm = NLMSG_DATA(nlh);
rtm->rtm_family = AF_DECnet; rtm->rtm_family = AF_DECnet;
rtm->rtm_dst_len = dst_len; rtm->rtm_dst_len = dst_len;
rtm->rtm_src_len = 0; rtm->rtm_src_len = 0;
rtm->rtm_tos = 0; rtm->rtm_tos = 0;
rtm->rtm_table = tb_id; rtm->rtm_table = tb_id;
RTA_PUT_U32(skb, RTA_TABLE, tb_id); RTA_PUT_U32(skb, RTA_TABLE, tb_id);
rtm->rtm_flags = fi->fib_flags; rtm->rtm_flags = fi->fib_flags;
rtm->rtm_scope = scope; rtm->rtm_scope = scope;
rtm->rtm_type = type; rtm->rtm_type = type;
if (rtm->rtm_dst_len) if (rtm->rtm_dst_len)
RTA_PUT(skb, RTA_DST, 2, dst); RTA_PUT(skb, RTA_DST, 2, dst);
rtm->rtm_protocol = fi->fib_protocol; rtm->rtm_protocol = fi->fib_protocol;
if (fi->fib_priority) if (fi->fib_priority)
RTA_PUT(skb, RTA_PRIORITY, 4, &fi->fib_priority); RTA_PUT(skb, RTA_PRIORITY, 4, &fi->fib_priority);
if (rtnetlink_put_metrics(skb, fi->fib_metrics) < 0) if (rtnetlink_put_metrics(skb, fi->fib_metrics) < 0)
goto rtattr_failure; goto rtattr_failure;
if (fi->fib_nhs == 1) { if (fi->fib_nhs == 1) {
if (fi->fib_nh->nh_gw) if (fi->fib_nh->nh_gw)
RTA_PUT(skb, RTA_GATEWAY, 2, &fi->fib_nh->nh_gw); RTA_PUT(skb, RTA_GATEWAY, 2, &fi->fib_nh->nh_gw);
if (fi->fib_nh->nh_oif) if (fi->fib_nh->nh_oif)
RTA_PUT(skb, RTA_OIF, sizeof(int), &fi->fib_nh->nh_oif); RTA_PUT(skb, RTA_OIF, sizeof(int), &fi->fib_nh->nh_oif);
} }
if (fi->fib_nhs > 1) { if (fi->fib_nhs > 1) {
struct rtnexthop *nhp; struct rtnexthop *nhp;
struct rtattr *mp_head; struct rtattr *mp_head;
if (skb_tailroom(skb) <= RTA_SPACE(0)) if (skb_tailroom(skb) <= RTA_SPACE(0))
goto rtattr_failure; goto rtattr_failure;
mp_head = (struct rtattr *)skb_put(skb, RTA_SPACE(0)); mp_head = (struct rtattr *)skb_put(skb, RTA_SPACE(0));
for_nexthops(fi) { for_nexthops(fi) {
if (skb_tailroom(skb) < RTA_ALIGN(RTA_ALIGN(sizeof(*nhp)) + 4)) if (skb_tailroom(skb) < RTA_ALIGN(RTA_ALIGN(sizeof(*nhp)) + 4))
goto rtattr_failure; goto rtattr_failure;
nhp = (struct rtnexthop *)skb_put(skb, RTA_ALIGN(sizeof(*nhp))); nhp = (struct rtnexthop *)skb_put(skb, RTA_ALIGN(sizeof(*nhp)));
nhp->rtnh_flags = nh->nh_flags & 0xFF; nhp->rtnh_flags = nh->nh_flags & 0xFF;
nhp->rtnh_hops = nh->nh_weight - 1; nhp->rtnh_hops = nh->nh_weight - 1;
nhp->rtnh_ifindex = nh->nh_oif; nhp->rtnh_ifindex = nh->nh_oif;
if (nh->nh_gw) if (nh->nh_gw)
RTA_PUT(skb, RTA_GATEWAY, 2, &nh->nh_gw); RTA_PUT(skb, RTA_GATEWAY, 2, &nh->nh_gw);
nhp->rtnh_len = skb->tail - (unsigned char *)nhp; nhp->rtnh_len = skb->tail - (unsigned char *)nhp;
} endfor_nexthops(fi); } endfor_nexthops(fi);
mp_head->rta_type = RTA_MULTIPATH; mp_head->rta_type = RTA_MULTIPATH;
mp_head->rta_len = skb->tail - (u8*)mp_head; mp_head->rta_len = skb->tail - (u8*)mp_head;
} }
nlh->nlmsg_len = skb->tail - b; nlh->nlmsg_len = skb->tail - b;
return skb->len; return skb->len;
nlmsg_failure: nlmsg_failure:
rtattr_failure: rtattr_failure:
skb_trim(skb, b - skb->data); skb_trim(skb, b - skb->data);
return -EMSGSIZE; return -EMSGSIZE;
} }
static void dn_rtmsg_fib(int event, struct dn_fib_node *f, int z, u32 tb_id, static void dn_rtmsg_fib(int event, struct dn_fib_node *f, int z, u32 tb_id,
struct nlmsghdr *nlh, struct netlink_skb_parms *req) struct nlmsghdr *nlh, struct netlink_skb_parms *req)
{ {
struct sk_buff *skb; struct sk_buff *skb;
u32 pid = req ? req->pid : 0; u32 pid = req ? req->pid : 0;
int err = -ENOBUFS; int err = -ENOBUFS;
skb = nlmsg_new(dn_fib_nlmsg_size(DN_FIB_INFO(f)), GFP_KERNEL); skb = nlmsg_new(dn_fib_nlmsg_size(DN_FIB_INFO(f)), GFP_KERNEL);
if (skb == NULL) if (skb == NULL)
goto errout; goto errout;
err = dn_fib_dump_info(skb, pid, nlh->nlmsg_seq, event, tb_id, err = dn_fib_dump_info(skb, pid, nlh->nlmsg_seq, event, tb_id,
f->fn_type, f->fn_scope, &f->fn_key, z, f->fn_type, f->fn_scope, &f->fn_key, z,
DN_FIB_INFO(f), 0); DN_FIB_INFO(f), 0);
if (err < 0) { if (err < 0) {
@@ -434,9 +434,9 @@ static __inline__ int dn_hash_dump_zone(struct sk_buff *skb,
} }
static int dn_fib_table_dump(struct dn_fib_table *tb, struct sk_buff *skb, static int dn_fib_table_dump(struct dn_fib_table *tb, struct sk_buff *skb,
struct netlink_callback *cb) struct netlink_callback *cb)
{ {
int m, s_m; int m, s_m;
struct dn_zone *dz; struct dn_zone *dz;
struct dn_hash *table = (struct dn_hash *)tb->data; struct dn_hash *table = (struct dn_hash *)tb->data;
@@ -457,7 +457,7 @@ static int dn_fib_table_dump(struct dn_fib_table *tb, struct sk_buff *skb,
read_unlock(&dn_fib_tables_lock); read_unlock(&dn_fib_tables_lock);
cb->args[2] = m; cb->args[2] = m;
return skb->len; return skb->len;
} }
int dn_fib_dump(struct sk_buff *skb, struct netlink_callback *cb) int dn_fib_dump(struct sk_buff *skb, struct netlink_callback *cb)
@@ -482,7 +482,7 @@ int dn_fib_dump(struct sk_buff *skb, struct netlink_callback *cb)
goto next; goto next;
if (dumped) if (dumped)
memset(&cb->args[2], 0, sizeof(cb->args) - memset(&cb->args[2], 0, sizeof(cb->args) -
2 * sizeof(cb->args[0])); 2 * sizeof(cb->args[0]));
if (tb->dump(tb, skb, cb) < 0) if (tb->dump(tb, skb, cb) < 0)
goto out; goto out;
dumped = 1; dumped = 1;
@@ -503,13 +503,13 @@ static int dn_fib_table_insert(struct dn_fib_table *tb, struct rtmsg *r, struct
struct dn_fib_node *new_f, *f, **fp, **del_fp; struct dn_fib_node *new_f, *f, **fp, **del_fp;
struct dn_zone *dz; struct dn_zone *dz;
struct dn_fib_info *fi; struct dn_fib_info *fi;
int z = r->rtm_dst_len; int z = r->rtm_dst_len;
int type = r->rtm_type; int type = r->rtm_type;
dn_fib_key_t key; dn_fib_key_t key;
int err; int err;
if (z > 16) if (z > 16)
return -EINVAL; return -EINVAL;
dz = table->dh_zones[z]; dz = table->dh_zones[z];
if (!dz && !(dz = dn_new_zone(table, z))) if (!dz && !(dz = dn_new_zone(table, z)))
@@ -524,8 +524,8 @@ static int dn_fib_table_insert(struct dn_fib_table *tb, struct rtmsg *r, struct
key = dz_key(dst, dz); key = dz_key(dst, dz);
} }
if ((fi = dn_fib_create_info(r, rta, n, &err)) == NULL) if ((fi = dn_fib_create_info(r, rta, n, &err)) == NULL)
return err; return err;
if (dz->dz_nent > (dz->dz_divisor << 2) && if (dz->dz_nent > (dz->dz_divisor << 2) &&
dz->dz_divisor > DN_MAX_DIVISOR && dz->dz_divisor > DN_MAX_DIVISOR &&
@@ -624,9 +624,9 @@ replace:
dn_rt_cache_flush(-1); dn_rt_cache_flush(-1);
} }
dn_rtmsg_fib(RTM_NEWROUTE, new_f, z, tb->n, n, req); dn_rtmsg_fib(RTM_NEWROUTE, new_f, z, tb->n, n, req);
return 0; return 0;
out: out:
dn_fib_release_info(fi); dn_fib_release_info(fi);
return err; return err;
@@ -637,14 +637,14 @@ static int dn_fib_table_delete(struct dn_fib_table *tb, struct rtmsg *r, struct
{ {
struct dn_hash *table = (struct dn_hash*)tb->data; struct dn_hash *table = (struct dn_hash*)tb->data;
struct dn_fib_node **fp, **del_fp, *f; struct dn_fib_node **fp, **del_fp, *f;
int z = r->rtm_dst_len; int z = r->rtm_dst_len;
struct dn_zone *dz; struct dn_zone *dz;
dn_fib_key_t key; dn_fib_key_t key;
int matched; int matched;
if (z > 16) if (z > 16)
return -EINVAL; return -EINVAL;
if ((dz = table->dh_zones[z]) == NULL) if ((dz = table->dh_zones[z]) == NULL)
return -ESRCH; return -ESRCH;
@@ -688,7 +688,7 @@ static int dn_fib_table_delete(struct dn_fib_table *tb, struct rtmsg *r, struct
if (del_fp) { if (del_fp) {
f = *del_fp; f = *del_fp;
dn_rtmsg_fib(RTM_DELROUTE, f, z, tb->n, n, req); dn_rtmsg_fib(RTM_DELROUTE, f, z, tb->n, n, req);
if (matched != 1) { if (matched != 1) {
write_lock_bh(&dn_fib_tables_lock); write_lock_bh(&dn_fib_tables_lock);
@@ -712,7 +712,7 @@ static int dn_fib_table_delete(struct dn_fib_table *tb, struct rtmsg *r, struct
return 0; return 0;
} }
return -ESRCH; return -ESRCH;
} }
static inline int dn_flush_list(struct dn_fib_node **fp, int z, struct dn_hash *table) static inline int dn_flush_list(struct dn_fib_node **fp, int z, struct dn_hash *table)
@@ -759,7 +759,7 @@ static int dn_fib_table_flush(struct dn_fib_table *tb)
static int dn_fib_table_lookup(struct dn_fib_table *tb, const struct flowi *flp, struct dn_fib_res *res) static int dn_fib_table_lookup(struct dn_fib_table *tb, const struct flowi *flp, struct dn_fib_res *res)
{ {
int err; int err;
struct dn_zone *dz; struct dn_zone *dz;
struct dn_hash *t = (struct dn_hash *)tb->data; struct dn_hash *t = (struct dn_hash *)tb->data;
@@ -799,21 +799,21 @@ static int dn_fib_table_lookup(struct dn_fib_table *tb, const struct flowi *flp,
err = 1; err = 1;
out: out:
read_unlock(&dn_fib_tables_lock); read_unlock(&dn_fib_tables_lock);
return err; return err;
} }
struct dn_fib_table *dn_fib_get_table(u32 n, int create) struct dn_fib_table *dn_fib_get_table(u32 n, int create)
{ {
struct dn_fib_table *t; struct dn_fib_table *t;
struct hlist_node *node; struct hlist_node *node;
unsigned int h; unsigned int h;
if (n < RT_TABLE_MIN) if (n < RT_TABLE_MIN)
return NULL; return NULL;
if (n > RT_TABLE_MAX) if (n > RT_TABLE_MAX)
return NULL; return NULL;
h = n & (DN_FIB_TABLE_HASHSZ - 1); h = n & (DN_FIB_TABLE_HASHSZ - 1);
rcu_read_lock(); rcu_read_lock();
@@ -825,54 +825,54 @@ struct dn_fib_table *dn_fib_get_table(u32 n, int create)
} }
rcu_read_unlock(); rcu_read_unlock();
if (!create) if (!create)
return NULL; return NULL;
if (in_interrupt() && net_ratelimit()) { if (in_interrupt() && net_ratelimit()) {
printk(KERN_DEBUG "DECnet: BUG! Attempt to create routing table from interrupt\n"); printk(KERN_DEBUG "DECnet: BUG! Attempt to create routing table from interrupt\n");
return NULL; return NULL;
} }
t = kzalloc(sizeof(struct dn_fib_table) + sizeof(struct dn_hash), t = kzalloc(sizeof(struct dn_fib_table) + sizeof(struct dn_hash),
GFP_KERNEL); GFP_KERNEL);
if (t == NULL) if (t == NULL)
return NULL; return NULL;
t->n = n; t->n = n;
t->insert = dn_fib_table_insert; t->insert = dn_fib_table_insert;
t->delete = dn_fib_table_delete; t->delete = dn_fib_table_delete;
t->lookup = dn_fib_table_lookup; t->lookup = dn_fib_table_lookup;
t->flush = dn_fib_table_flush; t->flush = dn_fib_table_flush;
t->dump = dn_fib_table_dump; t->dump = dn_fib_table_dump;
hlist_add_head_rcu(&t->hlist, &dn_fib_table_hash[h]); hlist_add_head_rcu(&t->hlist, &dn_fib_table_hash[h]);
return t; return t;
} }
struct dn_fib_table *dn_fib_empty_table(void) struct dn_fib_table *dn_fib_empty_table(void)
{ {
u32 id; u32 id;
for(id = RT_TABLE_MIN; id <= RT_TABLE_MAX; id++) for(id = RT_TABLE_MIN; id <= RT_TABLE_MAX; id++)
if (dn_fib_get_table(id, 0) == NULL) if (dn_fib_get_table(id, 0) == NULL)
return dn_fib_get_table(id, 1); return dn_fib_get_table(id, 1);
return NULL; return NULL;
} }
void dn_fib_flush(void) void dn_fib_flush(void)
{ {
int flushed = 0; int flushed = 0;
struct dn_fib_table *tb; struct dn_fib_table *tb;
struct hlist_node *node; struct hlist_node *node;
unsigned int h; unsigned int h;
for (h = 0; h < DN_FIB_TABLE_HASHSZ; h++) { for (h = 0; h < DN_FIB_TABLE_HASHSZ; h++) {
hlist_for_each_entry(tb, node, &dn_fib_table_hash[h], hlist) hlist_for_each_entry(tb, node, &dn_fib_table_hash[h], hlist)
flushed += tb->flush(tb); flushed += tb->flush(tb);
} }
if (flushed) if (flushed)
dn_rt_cache_flush(-1); dn_rt_cache_flush(-1);
} }
void __init dn_fib_table_init(void) void __init dn_fib_table_init(void)
@@ -892,7 +892,7 @@ void __exit dn_fib_table_cleanup(void)
write_lock(&dn_fib_tables_lock); write_lock(&dn_fib_tables_lock);
for (h = 0; h < DN_FIB_TABLE_HASHSZ; h++) { for (h = 0; h < DN_FIB_TABLE_HASHSZ; h++) {
hlist_for_each_entry_safe(t, node, next, &dn_fib_table_hash[h], hlist_for_each_entry_safe(t, node, next, &dn_fib_table_hash[h],
hlist) { hlist) {
hlist_del(&t->hlist); hlist_del(&t->hlist);
kfree(t); kfree(t);
} }

View File

@@ -138,7 +138,7 @@ static int __init dn_rtmsg_init(void)
int rv = 0; int rv = 0;
dnrmg = netlink_kernel_create(NETLINK_DNRTMSG, DNRNG_NLGRP_MAX, dnrmg = netlink_kernel_create(NETLINK_DNRTMSG, DNRNG_NLGRP_MAX,
dnrmg_receive_user_sk, THIS_MODULE); dnrmg_receive_user_sk, THIS_MODULE);
if (dnrmg == NULL) { if (dnrmg == NULL) {
printk(KERN_ERR "dn_rtmsg: Cannot create netlink socket"); printk(KERN_ERR "dn_rtmsg: Cannot create netlink socket");
return -ENOMEM; return -ENOMEM;

View File

@@ -432,32 +432,32 @@ static ctl_table dn_table[] = {
.extra2 = &max_decnet_no_fc_max_cwnd .extra2 = &max_decnet_no_fc_max_cwnd
}, },
{ {
.ctl_name = NET_DECNET_MEM, .ctl_name = NET_DECNET_MEM,
.procname = "decnet_mem", .procname = "decnet_mem",
.data = &sysctl_decnet_mem, .data = &sysctl_decnet_mem,
.maxlen = sizeof(sysctl_decnet_mem), .maxlen = sizeof(sysctl_decnet_mem),
.mode = 0644, .mode = 0644,
.proc_handler = &proc_dointvec, .proc_handler = &proc_dointvec,
.strategy = &sysctl_intvec, .strategy = &sysctl_intvec,
}, },
{ {
.ctl_name = NET_DECNET_RMEM, .ctl_name = NET_DECNET_RMEM,
.procname = "decnet_rmem", .procname = "decnet_rmem",
.data = &sysctl_decnet_rmem, .data = &sysctl_decnet_rmem,
.maxlen = sizeof(sysctl_decnet_rmem), .maxlen = sizeof(sysctl_decnet_rmem),
.mode = 0644, .mode = 0644,
.proc_handler = &proc_dointvec, .proc_handler = &proc_dointvec,
.strategy = &sysctl_intvec, .strategy = &sysctl_intvec,
}, },
{ {
.ctl_name = NET_DECNET_WMEM, .ctl_name = NET_DECNET_WMEM,
.procname = "decnet_wmem", .procname = "decnet_wmem",
.data = &sysctl_decnet_wmem, .data = &sysctl_decnet_wmem,
.maxlen = sizeof(sysctl_decnet_wmem), .maxlen = sizeof(sysctl_decnet_wmem),
.mode = 0644, .mode = 0644,
.proc_handler = &proc_dointvec, .proc_handler = &proc_dointvec,
.strategy = &sysctl_intvec, .strategy = &sysctl_intvec,
}, },
{ {
.ctl_name = NET_DECNET_DEBUG_LEVEL, .ctl_name = NET_DECNET_DEBUG_LEVEL,
.procname = "debug", .procname = "debug",

View File

@@ -663,7 +663,7 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
* any security data (IV, ICV, etc) that was left behind */ * any security data (IV, ICV, etc) that was left behind */
if (!can_be_decrypted && (fc & IEEE80211_FCTL_PROTECTED) && if (!can_be_decrypted && (fc & IEEE80211_FCTL_PROTECTED) &&
ieee->host_strip_iv_icv) { ieee->host_strip_iv_icv) {
int trimlen = 0; int trimlen = 0;
/* Top two-bits of byte 3 are the key index */ /* Top two-bits of byte 3 are the key index */
if (skb->len >= hdrlen + 3) if (skb->len >= hdrlen + 3)

View File

@@ -54,7 +54,7 @@ Desc. | ctrl | dura | DA/RA | TA | SA | Sequ | Frame | fcs |
| | tion | (BSSID) | | | ence | data | | | | tion | (BSSID) | | | ence | data | |
`--------------------------------------------------| |------' `--------------------------------------------------| |------'
Total: 28 non-data bytes `----.----' Total: 28 non-data bytes `----.----'
| |
.- 'Frame data' expands, if WEP enabled, to <----------' .- 'Frame data' expands, if WEP enabled, to <----------'
| |
V V
@@ -64,8 +64,8 @@ Bytes | 4 | 0-2296 | 4 |
Desc. | IV | Encrypted | ICV | Desc. | IV | Encrypted | ICV |
| | Packet | | | | Packet | |
`-----| |-----' `-----| |-----'
`-----.-----' `-----.-----'
| |
.- 'Encrypted Packet' expands to .- 'Encrypted Packet' expands to
| |
V V

View File

@@ -182,7 +182,7 @@ ieee80211softmac_auth_resp(struct net_device *dev, struct ieee80211_auth *auth)
case WLAN_STATUS_SUCCESS: case WLAN_STATUS_SUCCESS:
/* Update the status to Authenticated */ /* Update the status to Authenticated */
spin_lock_irqsave(&mac->lock, flags); spin_lock_irqsave(&mac->lock, flags);
net->authenticating = 0; net->authenticating = 0;
net->authenticated = 1; net->authenticated = 1;
spin_unlock_irqrestore(&mac->lock, flags); spin_unlock_irqrestore(&mac->lock, flags);
@@ -262,8 +262,8 @@ ieee80211softmac_auth_resp(struct net_device *dev, struct ieee80211_auth *auth)
MAC_ARG(net->bssid), le16_to_cpup(&auth->status)); MAC_ARG(net->bssid), le16_to_cpup(&auth->status));
/* Lock and reset flags */ /* Lock and reset flags */
spin_lock_irqsave(&mac->lock, flags); spin_lock_irqsave(&mac->lock, flags);
net->authenticating = 0; net->authenticating = 0;
net->authenticated = 0; net->authenticated = 0;
spin_unlock_irqrestore(&mac->lock, flags); spin_unlock_irqrestore(&mac->lock, flags);
/* Count the error? */ /* Count the error? */
break; break;

View File

@@ -445,8 +445,8 @@ ieee80211softmac_send_mgt_frame(struct ieee80211softmac_device *mac,
pkt_size = ieee80211softmac_probe_resp((struct ieee80211_probe_response **)(&pkt), mac, (struct ieee80211softmac_network *)ptrarg); pkt_size = ieee80211softmac_probe_resp((struct ieee80211_probe_response **)(&pkt), mac, (struct ieee80211softmac_network *)ptrarg);
break; break;
default: default:
printkl(KERN_DEBUG PFX "Unsupported Management Frame type: %i\n", type); printkl(KERN_DEBUG PFX "Unsupported Management Frame type: %i\n", type);
return -EINVAL; return -EINVAL;
}; };
if(pkt_size == 0 || pkt == NULL) { if(pkt_size == 0 || pkt == NULL) {

View File

@@ -44,7 +44,7 @@ struct net_device *alloc_ieee80211softmac(int sizeof_priv)
softmac->ieee->handle_assoc_response = ieee80211softmac_handle_assoc_response; softmac->ieee->handle_assoc_response = ieee80211softmac_handle_assoc_response;
softmac->ieee->handle_reassoc_request = ieee80211softmac_handle_reassoc_req; softmac->ieee->handle_reassoc_request = ieee80211softmac_handle_reassoc_req;
softmac->ieee->handle_disassoc = ieee80211softmac_handle_disassoc; softmac->ieee->handle_disassoc = ieee80211softmac_handle_disassoc;
softmac->ieee->handle_beacon = ieee80211softmac_handle_beacon; softmac->ieee->handle_beacon = ieee80211softmac_handle_beacon;
softmac->scaninfo = NULL; softmac->scaninfo = NULL;
softmac->associnfo.scan_retry = IEEE80211SOFTMAC_ASSOC_SCAN_RETRY_LIMIT; softmac->associnfo.scan_retry = IEEE80211SOFTMAC_ASSOC_SCAN_RETRY_LIMIT;
@@ -208,9 +208,9 @@ EXPORT_SYMBOL_GPL(ieee80211softmac_highest_supported_rate);
void ieee80211softmac_process_erp(struct ieee80211softmac_device *mac, void ieee80211softmac_process_erp(struct ieee80211softmac_device *mac,
u8 erp_value) u8 erp_value)
{ {
int use_protection; int use_protection;
int short_preamble; int short_preamble;
u32 changes = 0; u32 changes = 0;
/* Barker preamble mode */ /* Barker preamble mode */
short_preamble = ((erp_value & WLAN_ERP_BARKER_PREAMBLE) == 0 short_preamble = ((erp_value & WLAN_ERP_BARKER_PREAMBLE) == 0

View File

@@ -156,7 +156,7 @@ int ieee80211softmac_handle_assoc_response(struct net_device * dev,
int ieee80211softmac_handle_disassoc(struct net_device * dev, int ieee80211softmac_handle_disassoc(struct net_device * dev,
struct ieee80211_disassoc * disassoc); struct ieee80211_disassoc * disassoc);
int ieee80211softmac_handle_reassoc_req(struct net_device * dev, int ieee80211softmac_handle_reassoc_req(struct net_device * dev,
struct ieee80211_reassoc_request * reassoc); struct ieee80211_reassoc_request * reassoc);
void ieee80211softmac_assoc_timeout(struct work_struct *work); void ieee80211softmac_assoc_timeout(struct work_struct *work);
void ieee80211softmac_send_disassoc_req(struct ieee80211softmac_device *mac, u16 reason); void ieee80211softmac_send_disassoc_req(struct ieee80211softmac_device *mac, u16 reason);
void ieee80211softmac_disassoc(struct ieee80211softmac_device *mac); void ieee80211softmac_disassoc(struct ieee80211softmac_device *mac);

View File

@@ -366,7 +366,7 @@ ieee80211softmac_wx_set_wap(struct net_device *net_dev,
} else if (is_zero_ether_addr(data->ap_addr.sa_data)) { } else if (is_zero_ether_addr(data->ap_addr.sa_data)) {
/* the bssid we have is no longer fixed */ /* the bssid we have is no longer fixed */
mac->associnfo.bssfixed = 0; mac->associnfo.bssfixed = 0;
} else { } else {
if (!memcmp(mac->associnfo.bssid, data->ap_addr.sa_data, ETH_ALEN)) { if (!memcmp(mac->associnfo.bssid, data->ap_addr.sa_data, ETH_ALEN)) {
if (mac->associnfo.associating || mac->associnfo.associated) { if (mac->associnfo.associating || mac->associnfo.associated) {
/* bssid unchanged and associated or associating - just return */ /* bssid unchanged and associated or associating - just return */
@@ -380,7 +380,7 @@ ieee80211softmac_wx_set_wap(struct net_device *net_dev,
mac->associnfo.bssfixed = 1; mac->associnfo.bssfixed = 1;
/* queue associate if new bssid or (old one again and not associated) */ /* queue associate if new bssid or (old one again and not associated) */
schedule_delayed_work(&mac->associnfo.work, 0); schedule_delayed_work(&mac->associnfo.work, 0);
} }
out: out:
mutex_unlock(&mac->associnfo.mutex); mutex_unlock(&mac->associnfo.mutex);

View File

@@ -550,7 +550,7 @@ int inet_stream_connect(struct socket *sock, struct sockaddr *uaddr,
if (err < 0) if (err < 0)
goto out; goto out;
sock->state = SS_CONNECTING; sock->state = SS_CONNECTING;
/* Just entered SS_CONNECTING state; the only /* Just entered SS_CONNECTING state; the only
* difference is that return value in non-blocking * difference is that return value in non-blocking
@@ -878,36 +878,36 @@ static struct net_proto_family inet_family_ops = {
*/ */
static struct inet_protosw inetsw_array[] = static struct inet_protosw inetsw_array[] =
{ {
{ {
.type = SOCK_STREAM, .type = SOCK_STREAM,
.protocol = IPPROTO_TCP, .protocol = IPPROTO_TCP,
.prot = &tcp_prot, .prot = &tcp_prot,
.ops = &inet_stream_ops, .ops = &inet_stream_ops,
.capability = -1, .capability = -1,
.no_check = 0, .no_check = 0,
.flags = INET_PROTOSW_PERMANENT | .flags = INET_PROTOSW_PERMANENT |
INET_PROTOSW_ICSK, INET_PROTOSW_ICSK,
}, },
{ {
.type = SOCK_DGRAM, .type = SOCK_DGRAM,
.protocol = IPPROTO_UDP, .protocol = IPPROTO_UDP,
.prot = &udp_prot, .prot = &udp_prot,
.ops = &inet_dgram_ops, .ops = &inet_dgram_ops,
.capability = -1, .capability = -1,
.no_check = UDP_CSUM_DEFAULT, .no_check = UDP_CSUM_DEFAULT,
.flags = INET_PROTOSW_PERMANENT, .flags = INET_PROTOSW_PERMANENT,
}, },
{ {
.type = SOCK_RAW, .type = SOCK_RAW,
.protocol = IPPROTO_IP, /* wild card */ .protocol = IPPROTO_IP, /* wild card */
.prot = &raw_prot, .prot = &raw_prot,
.ops = &inet_sockraw_ops, .ops = &inet_sockraw_ops,
.capability = CAP_NET_RAW, .capability = CAP_NET_RAW,
.no_check = UDP_CSUM_DEFAULT, .no_check = UDP_CSUM_DEFAULT,
.flags = INET_PROTOSW_REUSE, .flags = INET_PROTOSW_REUSE,
} }
}; };
@@ -1276,7 +1276,7 @@ static int __init inet_init(void)
* Tell SOCKET that we are alive... * Tell SOCKET that we are alive...
*/ */
(void)sock_register(&inet_family_ops); (void)sock_register(&inet_family_ops);
/* /*
* Add all the base protocols. * Add all the base protocols.
@@ -1306,9 +1306,9 @@ static int __init inet_init(void)
arp_init(); arp_init();
/* /*
* Set the IP module up * Set the IP module up
*/ */
ip_init(); ip_init();

View File

@@ -166,7 +166,7 @@ static int ah_input(struct xfrm_state *x, struct sk_buff *skb)
if (ip_clear_mutable_options(iph, &dummy)) if (ip_clear_mutable_options(iph, &dummy))
goto out; goto out;
} }
{ {
u8 auth_data[MAX_AH_AUTH_LEN]; u8 auth_data[MAX_AH_AUTH_LEN];
memcpy(auth_data, ah->auth_data, ahp->icv_trunc_len); memcpy(auth_data, ah->auth_data, ahp->icv_trunc_len);

View File

@@ -490,7 +490,7 @@ int arp_find(unsigned char *haddr, struct sk_buff *skb)
n->used = jiffies; n->used = jiffies;
if (n->nud_state&NUD_VALID || neigh_event_send(n, skb) == 0) { if (n->nud_state&NUD_VALID || neigh_event_send(n, skb) == 0) {
read_lock_bh(&n->lock); read_lock_bh(&n->lock);
memcpy(haddr, n->ha, dev->addr_len); memcpy(haddr, n->ha, dev->addr_len);
read_unlock_bh(&n->lock); read_unlock_bh(&n->lock);
neigh_release(n); neigh_release(n);
return 0; return 0;
@@ -1181,7 +1181,7 @@ int arp_ioctl(unsigned int cmd, void __user *arg)
switch(cmd) { switch(cmd) {
case SIOCDARP: case SIOCDARP:
err = arp_req_delete(&r, dev); err = arp_req_delete(&r, dev);
break; break;
case SIOCSARP: case SIOCSARP:
err = arp_req_set(&r, dev); err = arp_req_set(&r, dev);

View File

@@ -31,10 +31,10 @@ int ip4_datagram_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len)
if (addr_len < sizeof(*usin)) if (addr_len < sizeof(*usin))
return -EINVAL; return -EINVAL;
if (usin->sin_family != AF_INET) if (usin->sin_family != AF_INET)
return -EAFNOSUPPORT; return -EAFNOSUPPORT;
sk_dst_reset(sk); sk_dst_reset(sk);
@@ -56,8 +56,8 @@ int ip4_datagram_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len)
ip_rt_put(rt); ip_rt_put(rt);
return -EACCES; return -EACCES;
} }
if (!inet->saddr) if (!inet->saddr)
inet->saddr = rt->rt_src; /* Update source address */ inet->saddr = rt->rt_src; /* Update source address */
if (!inet->rcv_saddr) if (!inet->rcv_saddr)
inet->rcv_saddr = rt->rt_src; inet->rcv_saddr = rt->rt_src;
inet->daddr = rt->rt_dst; inet->daddr = rt->rt_dst;

View File

@@ -583,8 +583,8 @@ static __inline__ int inet_abc_len(__be32 addr)
{ {
int rc = -1; /* Something else, probably a multicast. */ int rc = -1; /* Something else, probably a multicast. */
if (ZERONET(addr)) if (ZERONET(addr))
rc = 0; rc = 0;
else { else {
__u32 haddr = ntohl(addr); __u32 haddr = ntohl(addr);
@@ -596,7 +596,7 @@ static __inline__ int inet_abc_len(__be32 addr)
rc = 24; rc = 24;
} }
return rc; return rc;
} }
@@ -1539,7 +1539,7 @@ static struct devinet_sysctl_table {
}, },
}, },
.devinet_conf_dir = { .devinet_conf_dir = {
{ {
.ctl_name = NET_IPV4_CONF, .ctl_name = NET_IPV4_CONF,
.procname = "conf", .procname = "conf",
.mode = 0555, .mode = 0555,

View File

@@ -284,7 +284,7 @@ static u32 esp4_get_max_size(struct xfrm_state *x, int mtu)
mtu = ALIGN(mtu + 2, 4) + blksize - 4; mtu = ALIGN(mtu + 2, 4) + blksize - 4;
break; break;
case XFRM_MODE_BEET: case XFRM_MODE_BEET:
/* The worst case. */ /* The worst case. */
enclen = IPV4_BEET_PHMAXLEN; enclen = IPV4_BEET_PHMAXLEN;
mtu = ALIGN(mtu + enclen + 2, blksize); mtu = ALIGN(mtu + enclen + 2, blksize);
break; break;

View File

@@ -378,7 +378,7 @@ static int rtentry_to_fib_config(int cmd, struct rtentry *rt,
int len = 0; int len = 0;
mx = kzalloc(3 * nla_total_size(4), GFP_KERNEL); mx = kzalloc(3 * nla_total_size(4), GFP_KERNEL);
if (mx == NULL) if (mx == NULL)
return -ENOMEM; return -ENOMEM;
if (rt->rt_flags & RTF_MTU) if (rt->rt_flags & RTF_MTU)
@@ -600,7 +600,7 @@ int inet_dump_fib(struct sk_buff *skb, struct netlink_callback *cb)
goto next; goto next;
if (dumped) if (dumped)
memset(&cb->args[2], 0, sizeof(cb->args) - memset(&cb->args[2], 0, sizeof(cb->args) -
2 * sizeof(cb->args[0])); 2 * sizeof(cb->args[0]));
if (tb->tb_dump(tb, skb, cb) < 0) if (tb->tb_dump(tb, skb, cb) < 0)
goto out; goto out;
dumped = 1; dumped = 1;
@@ -791,7 +791,7 @@ static void nl_fib_lookup(struct fib_result_nl *frn, struct fib_table *tb )
static void nl_fib_input(struct sock *sk, int len) static void nl_fib_input(struct sock *sk, int len)
{ {
struct sk_buff *skb = NULL; struct sk_buff *skb = NULL;
struct nlmsghdr *nlh = NULL; struct nlmsghdr *nlh = NULL;
struct fib_result_nl *frn; struct fib_result_nl *frn;
u32 pid; u32 pid;
struct fib_table *tb; struct fib_table *tb;

View File

@@ -90,7 +90,7 @@ static const struct
int error; int error;
u8 scope; u8 scope;
} fib_props[RTA_MAX + 1] = { } fib_props[RTA_MAX + 1] = {
{ {
.error = 0, .error = 0,
.scope = RT_SCOPE_NOWHERE, .scope = RT_SCOPE_NOWHERE,
}, /* RTN_UNSPEC */ }, /* RTN_UNSPEC */
@@ -508,9 +508,9 @@ int fib_nh_match(struct fib_config *cfg, struct fib_info *fi)
Normally it looks as following. Normally it looks as following.
{universe prefix} -> (gw, oif) [scope link] {universe prefix} -> (gw, oif) [scope link]
| |
|-> {link prefix} -> (gw, oif) [scope local] |-> {link prefix} -> (gw, oif) [scope local]
| |
|-> {local prefix} (terminal node) |-> {local prefix} (terminal node)
*/ */
@@ -864,7 +864,7 @@ err_inval:
err = -EINVAL; err = -EINVAL;
failure: failure:
if (fi) { if (fi) {
fi->fib_dead = 1; fi->fib_dead = 1;
free_fib_info(fi); free_fib_info(fi);
} }

Some files were not shown because too many files have changed in this diff Show More