Commit ed4477b9 authored by YOSHIFUJI Hideaki's avatar YOSHIFUJI Hideaki Committed by David S. Miller

[NET] APPLETALK: Fix whitespace errors.

Signed-off-by: default avatarYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 122952fc
...@@ -895,7 +895,7 @@ struct aarp_iter_state { ...@@ -895,7 +895,7 @@ struct aarp_iter_state {
/* /*
* Get the aarp entry that is in the chain described * Get the aarp entry that is in the chain described
* by the iterator. * by the iterator.
* If pos is set then skip till that index. * If pos is set then skip till that index.
* pos = 1 is the first entry * pos = 1 is the first entry
*/ */
...@@ -905,7 +905,7 @@ static struct aarp_entry *iter_next(struct aarp_iter_state *iter, loff_t *pos) ...@@ -905,7 +905,7 @@ static struct aarp_entry *iter_next(struct aarp_iter_state *iter, loff_t *pos)
struct aarp_entry **table = iter->table; struct aarp_entry **table = iter->table;
loff_t off = 0; loff_t off = 0;
struct aarp_entry *entry; struct aarp_entry *entry;
rescan: rescan:
while(ct < AARP_HASH_SIZE) { while(ct < AARP_HASH_SIZE) {
for (entry = table[ct]; entry; entry = entry->next) { for (entry = table[ct]; entry; entry = entry->next) {
...@@ -950,9 +950,9 @@ static void *aarp_seq_next(struct seq_file *seq, void *v, loff_t *pos) ...@@ -950,9 +950,9 @@ static void *aarp_seq_next(struct seq_file *seq, void *v, loff_t *pos)
++*pos; ++*pos;
/* first line after header */ /* first line after header */
if (v == SEQ_START_TOKEN) if (v == SEQ_START_TOKEN)
entry = iter_next(iter, NULL); entry = iter_next(iter, NULL);
/* next entry in current bucket */ /* next entry in current bucket */
else if (entry->next) else if (entry->next)
entry = entry->next; entry = entry->next;
...@@ -986,7 +986,7 @@ static int aarp_seq_show(struct seq_file *seq, void *v) ...@@ -986,7 +986,7 @@ static int aarp_seq_show(struct seq_file *seq, void *v)
unsigned long now = jiffies; unsigned long now = jiffies;
if (v == SEQ_START_TOKEN) if (v == SEQ_START_TOKEN)
seq_puts(seq, seq_puts(seq,
"Address Interface Hardware Address" "Address Interface Hardware Address"
" Expires LastSend Retry Status\n"); " Expires LastSend Retry Status\n");
else { else {
...@@ -1014,7 +1014,7 @@ static int aarp_seq_show(struct seq_file *seq, void *v) ...@@ -1014,7 +1014,7 @@ static int aarp_seq_show(struct seq_file *seq, void *v)
: (iter->table == unresolved) ? "unresolved" : (iter->table == unresolved) ? "unresolved"
: (iter->table == proxies) ? "proxies" : (iter->table == proxies) ? "proxies"
: "unknown"); : "unknown");
} }
return 0; return 0;
} }
...@@ -1030,7 +1030,7 @@ static int aarp_seq_open(struct inode *inode, struct file *file) ...@@ -1030,7 +1030,7 @@ static int aarp_seq_open(struct inode *inode, struct file *file)
struct seq_file *seq; struct seq_file *seq;
int rc = -ENOMEM; int rc = -ENOMEM;
struct aarp_iter_state *s = kmalloc(sizeof(*s), GFP_KERNEL); struct aarp_iter_state *s = kmalloc(sizeof(*s), GFP_KERNEL);
if (!s) if (!s)
goto out; goto out;
......
...@@ -292,7 +292,7 @@ int __init atalk_proc_init(void) ...@@ -292,7 +292,7 @@ int __init atalk_proc_init(void)
p->proc_fops = &atalk_seq_socket_fops; p->proc_fops = &atalk_seq_socket_fops;
p = create_proc_entry("arp", S_IRUGO, atalk_proc_dir); p = create_proc_entry("arp", S_IRUGO, atalk_proc_dir);
if (!p) if (!p)
goto out_arp; goto out_arp;
p->proc_fops = &atalk_seq_arp_fops; p->proc_fops = &atalk_seq_arp_fops;
......
...@@ -28,16 +28,16 @@ ...@@ -28,16 +28,16 @@
* Bradford Johnson : IP-over-DDP (experimental) * Bradford Johnson : IP-over-DDP (experimental)
* Jay Schulist : Moved IP-over-DDP to its own * Jay Schulist : Moved IP-over-DDP to its own
* driver file. (ipddp.c & ipddp.h) * driver file. (ipddp.c & ipddp.h)
* Jay Schulist : Made work as module with * Jay Schulist : Made work as module with
* AppleTalk drivers, cleaned it. * AppleTalk drivers, cleaned it.
* Rob Newberry : Added proxy AARP and AARP * Rob Newberry : Added proxy AARP and AARP
* procfs, moved probing to AARP * procfs, moved probing to AARP
* module. * module.
* Adrian Sun/ * Adrian Sun/
* Michael Zuelsdorff : fix for net.0 packets. don't * Michael Zuelsdorff : fix for net.0 packets. don't
* allow illegal ether/tokentalk * allow illegal ether/tokentalk
* port assignment. we lose a * port assignment. we lose a
* valid localtalk port as a * valid localtalk port as a
* result. * result.
* Arnaldo C. de Melo : Cleanup, in preparation for * Arnaldo C. de Melo : Cleanup, in preparation for
* shared skb support 8) * shared skb support 8)
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version * as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version. * 2 of the License, or (at your option) any later version.
* *
*/ */
#include <linux/capability.h> #include <linux/capability.h>
...@@ -100,17 +100,17 @@ static struct sock *atalk_search_socket(struct sockaddr_at *to, ...@@ -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 &&
...@@ -314,7 +314,7 @@ static int atif_proxy_probe_device(struct atalk_iface *atif, ...@@ -314,7 +314,7 @@ static int atif_proxy_probe_device(struct atalk_iface *atif,
if (probe_node == ATADDR_ANYNODE) if (probe_node == ATADDR_ANYNODE)
probe_node = jiffies & 0xFF; probe_node = jiffies & 0xFF;
/* Scan the networks */ /* Scan the networks */
for (netct = 0; netct <= netrange; netct++) { for (netct = 0; netct <= netrange; netct++) {
/* Sweep the available nodes from a given start */ /* Sweep the available nodes from a given start */
...@@ -417,7 +417,7 @@ static struct atalk_iface *atalk_find_interface(__be16 net, int node) ...@@ -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;
...@@ -432,13 +432,13 @@ static struct atalk_iface *atalk_find_interface(__be16 net, int node) ...@@ -432,13 +432,13 @@ static struct atalk_iface *atalk_find_interface(__be16 net, int node)
static struct atalk_route *atrtr_find(struct atalk_addr *target) static struct atalk_route *atrtr_find(struct atalk_addr *target)
{ {
/* /*
* we must search through all routes unless we find a * we must search through all routes unless we find a
* host route, because some host routes might overlap * host route, because some host routes might overlap
* network routes * network routes
*/ */
struct atalk_route *net_route = NULL; struct atalk_route *net_route = NULL;
struct atalk_route *r; struct atalk_route *r;
read_lock_bh(&atalk_routes_lock); read_lock_bh(&atalk_routes_lock);
for (r = atalk_routes; r; r = r->next) { for (r = atalk_routes; r; r = r->next) {
if (!(r->flags & RTF_UP)) if (!(r->flags & RTF_UP))
...@@ -460,8 +460,8 @@ static struct atalk_route *atrtr_find(struct atalk_addr *target) ...@@ -460,8 +460,8 @@ static struct atalk_route *atrtr_find(struct atalk_addr *target)
net_route = r; net_route = r;
} }
} }
/* /*
* if we found a network route but not a direct host * if we found a network route but not a direct host
* route, then return it * route, then return it
*/ */
...@@ -540,15 +540,15 @@ static int atrtr_create(struct rtentry *r, struct net_device *devhint) ...@@ -540,15 +540,15 @@ 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 &&
ga->sat_addr.s_node == iface->address.s_node) ga->sat_addr.s_node == iface->address.s_node)
riface = iface; riface = iface;
} }
read_unlock_bh(&atalk_interfaces_lock); read_unlock_bh(&atalk_interfaces_lock);
retval = -ENETUNREACH; retval = -ENETUNREACH;
...@@ -649,7 +649,7 @@ static int ddp_device_event(struct notifier_block *this, unsigned long event, ...@@ -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,13 +701,13 @@ static int atif_ioctl(int cmd, void __user *arg) ...@@ -701,13 +701,13 @@ 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");
add_route = 0; add_route = 0;
} }
/* /*
* 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.
...@@ -797,78 +797,78 @@ static int atif_ioctl(int cmd, void __user *arg) ...@@ -797,78 +797,78 @@ 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)
return -EINVAL; return -EINVAL;
atalk_dev_down(dev); atalk_dev_down(dev);
break; break;
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;
...@@ -899,7 +899,7 @@ static int atrtr_ioctl(unsigned int cmd, void __user *arg) ...@@ -899,7 +899,7 @@ static int atrtr_ioctl(unsigned int cmd, void __user *arg)
dev = __dev_get_by_name(name); dev = __dev_get_by_name(name);
if (!dev) if (!dev)
return -ENODEV; return -ENODEV;
} }
return atrtr_create(&rt, dev); return atrtr_create(&rt, dev);
} }
} }
...@@ -917,7 +917,7 @@ static int atrtr_ioctl(unsigned int cmd, void __user *arg) ...@@ -917,7 +917,7 @@ static int atrtr_ioctl(unsigned int cmd, void __user *arg)
* Checksum: This is 'optional'. It's quite likely also a good * Checksum: This is 'optional'. It's quite likely also a good
* candidate for assembler hackery 8) * candidate for assembler hackery 8)
*/ */
static unsigned long atalk_sum_partial(const unsigned char *data, static unsigned long atalk_sum_partial(const unsigned char *data,
int len, unsigned long sum) int len, unsigned long sum)
{ {
/* This ought to be unwrapped neatly. I'll trust gcc for now */ /* This ought to be unwrapped neatly. I'll trust gcc for now */
...@@ -945,7 +945,7 @@ static unsigned long atalk_sum_skb(const struct sk_buff *skb, int offset, ...@@ -945,7 +945,7 @@ static unsigned long atalk_sum_skb(const struct sk_buff *skb, int offset,
if (copy > len) if (copy > len)
copy = len; copy = len;
sum = atalk_sum_partial(skb->data + offset, copy, sum); sum = atalk_sum_partial(skb->data + offset, copy, sum);
if ( (len -= copy) == 0) if ( (len -= copy) == 0)
return sum; return sum;
offset += copy; offset += copy;
...@@ -1031,7 +1031,7 @@ static int atalk_create(struct socket *sock, int protocol) ...@@ -1031,7 +1031,7 @@ static int atalk_create(struct socket *sock, int protocol)
/* /*
* We permit SOCK_DGRAM and RAW is an extension. It is trivial to do * We permit SOCK_DGRAM and RAW is an extension. It is trivial to do
* and gives you the full ELAP frame. Should be handy for CAP 8) * and gives you the full ELAP frame. Should be handy for CAP 8)
*/ */
if (sock->type != SOCK_RAW && sock->type != SOCK_DGRAM) if (sock->type != SOCK_RAW && sock->type != SOCK_DGRAM)
goto out; goto out;
...@@ -1196,14 +1196,14 @@ static int atalk_connect(struct socket *sock, struct sockaddr *uaddr, ...@@ -1196,14 +1196,14 @@ static int atalk_connect(struct socket *sock, struct sockaddr *uaddr,
if (addr->sat_addr.s_node == ATADDR_BCAST && if (addr->sat_addr.s_node == ATADDR_BCAST &&
!sock_flag(sk, SOCK_BROADCAST)) { !sock_flag(sk, SOCK_BROADCAST)) {
#if 1 #if 1
printk(KERN_WARNING "%s is broken and did not set " printk(KERN_WARNING "%s is broken and did not set "
"SO_BROADCAST. It will break when 2.2 is " "SO_BROADCAST. It will break when 2.2 is "
"released.\n", "released.\n",
current->comm); current->comm);
#else #else
return -EACCES; return -EACCES;
#endif #endif
} }
if (sock_flag(sk, SOCK_ZAPPED)) if (sock_flag(sk, SOCK_ZAPPED))
...@@ -1260,27 +1260,27 @@ static int atalk_getname(struct socket *sock, struct sockaddr *uaddr, ...@@ -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
...@@ -1298,7 +1298,7 @@ static void atalk_route_packet(struct sk_buff *skb, struct net_device *dev, ...@@ -1298,7 +1298,7 @@ static void atalk_route_packet(struct sk_buff *skb, struct net_device *dev,
/* /*
* Don't route multicast, etc., packets, or packets sent to "this * Don't route multicast, etc., packets, or packets sent to "this
* network" * network"
*/ */
if (skb->pkt_type != PACKET_HOST || !ddp->deh_dnet) { if (skb->pkt_type != PACKET_HOST || !ddp->deh_dnet) {
/* /*
...@@ -1335,8 +1335,8 @@ static void atalk_route_packet(struct sk_buff *skb, struct net_device *dev, ...@@ -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))));
...@@ -1358,12 +1358,12 @@ static void atalk_route_packet(struct sk_buff *skb, struct net_device *dev, ...@@ -1358,12 +1358,12 @@ static void atalk_route_packet(struct sk_buff *skb, struct net_device *dev,
/* 22 bytes - 12 ether, 2 len, 3 802.2 5 snap */ /* 22 bytes - 12 ether, 2 len, 3 802.2 5 snap */
struct sk_buff *nskb = skb_realloc_headroom(skb, 32); struct sk_buff *nskb = skb_realloc_headroom(skb, 32);
kfree_skb(skb); kfree_skb(skb);
if (!nskb) if (!nskb)
goto out; goto out;
skb = nskb; skb = nskb;
} else } else
skb = skb_unshare(skb, GFP_ATOMIC); skb = skb_unshare(skb, GFP_ATOMIC);
/* /*
* If the buffer didn't vanish into the lack of space bitbucket we can * If the buffer didn't vanish into the lack of space bitbucket we can
* send it. * send it.
...@@ -1395,13 +1395,13 @@ static int atalk_rcv(struct sk_buff *skb, struct net_device *dev, ...@@ -1395,13 +1395,13 @@ 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 */
if (!(skb = skb_share_check(skb, GFP_ATOMIC))) if (!(skb = skb_share_check(skb, GFP_ATOMIC)))
goto out; goto out;
/* Size check and make sure header is contiguous */ /* Size check and make sure header is contiguous */
if (!pskb_may_pull(skb, sizeof(*ddp))) if (!pskb_may_pull(skb, sizeof(*ddp)))
goto freeit; goto freeit;
...@@ -1490,7 +1490,7 @@ static int ltalk_rcv(struct sk_buff *skb, struct net_device *dev, ...@@ -1490,7 +1490,7 @@ static int ltalk_rcv(struct sk_buff *skb, struct net_device *dev,
goto freeit; goto freeit;
/* Don't mangle buffer if shared */ /* Don't mangle buffer if shared */
if (!(skb = skb_share_check(skb, GFP_ATOMIC))) if (!(skb = skb_share_check(skb, GFP_ATOMIC)))
return 0; return 0;
/* /*
...@@ -1501,11 +1501,11 @@ static int ltalk_rcv(struct sk_buff *skb, struct net_device *dev, ...@@ -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 */
...@@ -1605,7 +1605,7 @@ static int atalk_sendmsg(struct kiocb *iocb, struct socket *sock, struct msghdr ...@@ -1605,7 +1605,7 @@ static int atalk_sendmsg(struct kiocb *iocb, struct socket *sock, struct msghdr
skb = sock_alloc_send_skb(sk, size, (flags & MSG_DONTWAIT), &err); skb = sock_alloc_send_skb(sk, size, (flags & MSG_DONTWAIT), &err);
if (!skb) if (!skb)
return err; return err;
skb->sk = sk; skb->sk = sk;
skb_reserve(skb, ddp_dl->header_length); skb_reserve(skb, ddp_dl->header_length);
skb_reserve(skb, dev->hard_header_len); skb_reserve(skb, dev->hard_header_len);
......
...@@ -15,14 +15,14 @@ static int ltalk_change_mtu(struct net_device *dev, int mtu) ...@@ -15,14 +15,14 @@ static int ltalk_change_mtu(struct net_device *dev, int mtu)
} }
static int ltalk_mac_addr(struct net_device *dev, void *addr) static int ltalk_mac_addr(struct net_device *dev, void *addr)
{ {
return -EINVAL; return -EINVAL;
} }
static void ltalk_setup(struct net_device *dev) static void ltalk_setup(struct net_device *dev)
{ {
/* Fill in the fields of the device structure with localtalk-generic values. */ /* Fill in the fields of the device structure with localtalk-generic values. */
dev->change_mtu = ltalk_change_mtu; dev->change_mtu = ltalk_change_mtu;
dev->hard_header = NULL; dev->hard_header = NULL;
dev->rebuild_header = NULL; dev->rebuild_header = NULL;
...@@ -34,8 +34,8 @@ static void ltalk_setup(struct net_device *dev) ...@@ -34,8 +34,8 @@ static void ltalk_setup(struct net_device *dev)
dev->hard_header_len = LTALK_HLEN; dev->hard_header_len = LTALK_HLEN;
dev->mtu = LTALK_MTU; dev->mtu = LTALK_MTU;
dev->addr_len = LTALK_ALEN; dev->addr_len = LTALK_ALEN;
dev->tx_queue_len = 10; dev->tx_queue_len = 10;
dev->broadcast[0] = 0xFF; dev->broadcast[0] = 0xFF;
dev->flags = IFF_BROADCAST|IFF_MULTICAST|IFF_NOARP; dev->flags = IFF_BROADCAST|IFF_MULTICAST|IFF_NOARP;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment