aboutsummaryrefslogtreecommitdiffstats
path: root/net/appletalk
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-02-11 14:38:13 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-02-11 14:38:13 -0500
commitcb18eccff48ef3986d1072964590bce6fec705fb (patch)
tree777fb1d15e0281341e1e02c9803d989538d346f2 /net/appletalk
parentc827ba4cb49a30ce581201fd0ba2be77cde412c7 (diff)
parent5ef213f6842277ee1df5659f59fac0ffc9beb411 (diff)
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. ...
Diffstat (limited to 'net/appletalk')
-rw-r--r--net/appletalk/aarp.c14
-rw-r--r--net/appletalk/atalk_proc.c2
-rw-r--r--net/appletalk/ddp.c218
-rw-r--r--net/appletalk/dev.c8
4 files changed, 121 insertions, 121 deletions
diff --git a/net/appletalk/aarp.c b/net/appletalk/aarp.c
index f3777ec5bcb9..27e845d260a9 100644
--- a/net/appletalk/aarp.c
+++ b/net/appletalk/aarp.c
@@ -895,7 +895,7 @@ struct aarp_iter_state {
895 895
896/* 896/*
897 * Get the aarp entry that is in the chain described 897 * Get the aarp entry that is in the chain described
898 * by the iterator. 898 * by the iterator.
899 * If pos is set then skip till that index. 899 * If pos is set then skip till that index.
900 * pos = 1 is the first entry 900 * pos = 1 is the first entry
901 */ 901 */
@@ -905,7 +905,7 @@ static struct aarp_entry *iter_next(struct aarp_iter_state *iter, loff_t *pos)
905 struct aarp_entry **table = iter->table; 905 struct aarp_entry **table = iter->table;
906 loff_t off = 0; 906 loff_t off = 0;
907 struct aarp_entry *entry; 907 struct aarp_entry *entry;
908 908
909 rescan: 909 rescan:
910 while(ct < AARP_HASH_SIZE) { 910 while(ct < AARP_HASH_SIZE) {
911 for (entry = table[ct]; entry; entry = entry->next) { 911 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 ++*pos; 950 ++*pos;
951 951
952 /* first line after header */ 952 /* first line after header */
953 if (v == SEQ_START_TOKEN) 953 if (v == SEQ_START_TOKEN)
954 entry = iter_next(iter, NULL); 954 entry = iter_next(iter, NULL);
955 955
956 /* next entry in current bucket */ 956 /* next entry in current bucket */
957 else if (entry->next) 957 else if (entry->next)
958 entry = entry->next; 958 entry = entry->next;
@@ -986,7 +986,7 @@ static int aarp_seq_show(struct seq_file *seq, void *v)
986 unsigned long now = jiffies; 986 unsigned long now = jiffies;
987 987
988 if (v == SEQ_START_TOKEN) 988 if (v == SEQ_START_TOKEN)
989 seq_puts(seq, 989 seq_puts(seq,
990 "Address Interface Hardware Address" 990 "Address Interface Hardware Address"
991 " Expires LastSend Retry Status\n"); 991 " Expires LastSend Retry Status\n");
992 else { 992 else {
@@ -1014,7 +1014,7 @@ static int aarp_seq_show(struct seq_file *seq, void *v)
1014 : (iter->table == unresolved) ? "unresolved" 1014 : (iter->table == unresolved) ? "unresolved"
1015 : (iter->table == proxies) ? "proxies" 1015 : (iter->table == proxies) ? "proxies"
1016 : "unknown"); 1016 : "unknown");
1017 } 1017 }
1018 return 0; 1018 return 0;
1019} 1019}
1020 1020
@@ -1030,7 +1030,7 @@ static int aarp_seq_open(struct inode *inode, struct file *file)
1030 struct seq_file *seq; 1030 struct seq_file *seq;
1031 int rc = -ENOMEM; 1031 int rc = -ENOMEM;
1032 struct aarp_iter_state *s = kmalloc(sizeof(*s), GFP_KERNEL); 1032 struct aarp_iter_state *s = kmalloc(sizeof(*s), GFP_KERNEL);
1033 1033
1034 if (!s) 1034 if (!s)
1035 goto out; 1035 goto out;
1036 1036
diff --git a/net/appletalk/atalk_proc.c b/net/appletalk/atalk_proc.c
index 7ae4916cd26d..bc3015f277ba 100644
--- a/net/appletalk/atalk_proc.c
+++ b/net/appletalk/atalk_proc.c
@@ -292,7 +292,7 @@ int __init atalk_proc_init(void)
292 p->proc_fops = &atalk_seq_socket_fops; 292 p->proc_fops = &atalk_seq_socket_fops;
293 293
294 p = create_proc_entry("arp", S_IRUGO, atalk_proc_dir); 294 p = create_proc_entry("arp", S_IRUGO, atalk_proc_dir);
295 if (!p) 295 if (!p)
296 goto out_arp; 296 goto out_arp;
297 p->proc_fops = &atalk_seq_arp_fops; 297 p->proc_fops = &atalk_seq_arp_fops;
298 298
diff --git a/net/appletalk/ddp.c b/net/appletalk/ddp.c
index 3a7052207708..113c175f1715 100644
--- a/net/appletalk/ddp.c
+++ b/net/appletalk/ddp.c
@@ -28,16 +28,16 @@
28 * Bradford Johnson : IP-over-DDP (experimental) 28 * Bradford Johnson : IP-over-DDP (experimental)
29 * Jay Schulist : Moved IP-over-DDP to its own 29 * Jay Schulist : Moved IP-over-DDP to its own
30 * driver file. (ipddp.c & ipddp.h) 30 * driver file. (ipddp.c & ipddp.h)
31 * Jay Schulist : Made work as module with 31 * Jay Schulist : Made work as module with
32 * AppleTalk drivers, cleaned it. 32 * AppleTalk drivers, cleaned it.
33 * Rob Newberry : Added proxy AARP and AARP 33 * Rob Newberry : Added proxy AARP and AARP
34 * procfs, moved probing to AARP 34 * procfs, moved probing to AARP
35 * module. 35 * module.
36 * Adrian Sun/ 36 * Adrian Sun/
37 * Michael Zuelsdorff : fix for net.0 packets. don't 37 * Michael Zuelsdorff : fix for net.0 packets. don't
38 * allow illegal ether/tokentalk 38 * allow illegal ether/tokentalk
39 * port assignment. we lose a 39 * port assignment. we lose a
40 * valid localtalk port as a 40 * valid localtalk port as a
41 * result. 41 * result.
42 * Arnaldo C. de Melo : Cleanup, in preparation for 42 * Arnaldo C. de Melo : Cleanup, in preparation for
43 * shared skb support 8) 43 * shared skb support 8)
@@ -48,7 +48,7 @@
48 * modify it under the terms of the GNU General Public License 48 * modify it under the terms of the GNU General Public License
49 * as published by the Free Software Foundation; either version 49 * as published by the Free Software Foundation; either version
50 * 2 of the License, or (at your option) any later version. 50 * 2 of the License, or (at your option) any later version.
51 * 51 *
52 */ 52 */
53 53
54#include <linux/capability.h> 54#include <linux/capability.h>
@@ -100,17 +100,17 @@ static struct sock *atalk_search_socket(struct sockaddr_at *to,
100 if (to->sat_port != at->src_port) 100 if (to->sat_port != at->src_port)
101 continue; 101 continue;
102 102
103 if (to->sat_addr.s_net == ATADDR_ANYNET && 103 if (to->sat_addr.s_net == ATADDR_ANYNET &&
104 to->sat_addr.s_node == ATADDR_BCAST) 104 to->sat_addr.s_node == ATADDR_BCAST)
105 goto found; 105 goto found;
106 106
107 if (to->sat_addr.s_net == at->src_net && 107 if (to->sat_addr.s_net == at->src_net &&
108 (to->sat_addr.s_node == at->src_node || 108 (to->sat_addr.s_node == at->src_node ||
109 to->sat_addr.s_node == ATADDR_BCAST || 109 to->sat_addr.s_node == ATADDR_BCAST ||
110 to->sat_addr.s_node == ATADDR_ANYNODE)) 110 to->sat_addr.s_node == ATADDR_ANYNODE))
111 goto found; 111 goto found;
112 112
113 /* XXXX.0 -- we got a request for this router. make sure 113 /* XXXX.0 -- we got a request for this router. make sure
114 * that the node is appropriately set. */ 114 * that the node is appropriately set. */
115 if (to->sat_addr.s_node == ATADDR_ANYNODE && 115 if (to->sat_addr.s_node == ATADDR_ANYNODE &&
116 to->sat_addr.s_net != ATADDR_ANYNET && 116 to->sat_addr.s_net != ATADDR_ANYNET &&
@@ -314,7 +314,7 @@ static int atif_proxy_probe_device(struct atalk_iface *atif,
314 314
315 if (probe_node == ATADDR_ANYNODE) 315 if (probe_node == ATADDR_ANYNODE)
316 probe_node = jiffies & 0xFF; 316 probe_node = jiffies & 0xFF;
317 317
318 /* Scan the networks */ 318 /* Scan the networks */
319 for (netct = 0; netct <= netrange; netct++) { 319 for (netct = 0; netct <= netrange; netct++) {
320 /* Sweep the available nodes from a given start */ 320 /* Sweep the available nodes from a given start */
@@ -417,7 +417,7 @@ static struct atalk_iface *atalk_find_interface(__be16 net, int node)
417 if (node == ATADDR_ANYNODE && net != ATADDR_ANYNET && 417 if (node == ATADDR_ANYNODE && net != ATADDR_ANYNET &&
418 ntohs(iface->nets.nr_firstnet) <= ntohs(net) && 418 ntohs(iface->nets.nr_firstnet) <= ntohs(net) &&
419 ntohs(net) <= ntohs(iface->nets.nr_lastnet)) 419 ntohs(net) <= ntohs(iface->nets.nr_lastnet))
420 break; 420 break;
421 } 421 }
422 read_unlock_bh(&atalk_interfaces_lock); 422 read_unlock_bh(&atalk_interfaces_lock);
423 return iface; 423 return iface;
@@ -432,13 +432,13 @@ static struct atalk_iface *atalk_find_interface(__be16 net, int node)
432static struct atalk_route *atrtr_find(struct atalk_addr *target) 432static struct atalk_route *atrtr_find(struct atalk_addr *target)
433{ 433{
434 /* 434 /*
435 * we must search through all routes unless we find a 435 * we must search through all routes unless we find a
436 * host route, because some host routes might overlap 436 * host route, because some host routes might overlap
437 * network routes 437 * network routes
438 */ 438 */
439 struct atalk_route *net_route = NULL; 439 struct atalk_route *net_route = NULL;
440 struct atalk_route *r; 440 struct atalk_route *r;
441 441
442 read_lock_bh(&atalk_routes_lock); 442 read_lock_bh(&atalk_routes_lock);
443 for (r = atalk_routes; r; r = r->next) { 443 for (r = atalk_routes; r; r = r->next) {
444 if (!(r->flags & RTF_UP)) 444 if (!(r->flags & RTF_UP))
@@ -460,8 +460,8 @@ static struct atalk_route *atrtr_find(struct atalk_addr *target)
460 net_route = r; 460 net_route = r;
461 } 461 }
462 } 462 }
463 463
464 /* 464 /*
465 * if we found a network route but not a direct host 465 * if we found a network route but not a direct host
466 * route, then return it 466 * route, then return it
467 */ 467 */
@@ -540,15 +540,15 @@ static int atrtr_create(struct rtentry *r, struct net_device *devhint)
540 for (iface = atalk_interfaces; iface; iface = iface->next) { 540 for (iface = atalk_interfaces; iface; iface = iface->next) {
541 if (!riface && 541 if (!riface &&
542 ntohs(ga->sat_addr.s_net) >= 542 ntohs(ga->sat_addr.s_net) >=
543 ntohs(iface->nets.nr_firstnet) && 543 ntohs(iface->nets.nr_firstnet) &&
544 ntohs(ga->sat_addr.s_net) <= 544 ntohs(ga->sat_addr.s_net) <=
545 ntohs(iface->nets.nr_lastnet)) 545 ntohs(iface->nets.nr_lastnet))
546 riface = iface; 546 riface = iface;
547 547
548 if (ga->sat_addr.s_net == iface->address.s_net && 548 if (ga->sat_addr.s_net == iface->address.s_net &&
549 ga->sat_addr.s_node == iface->address.s_node) 549 ga->sat_addr.s_node == iface->address.s_node)
550 riface = iface; 550 riface = iface;
551 } 551 }
552 read_unlock_bh(&atalk_interfaces_lock); 552 read_unlock_bh(&atalk_interfaces_lock);
553 553
554 retval = -ENETUNREACH; 554 retval = -ENETUNREACH;
@@ -649,7 +649,7 @@ static int ddp_device_event(struct notifier_block *this, unsigned long event,
649{ 649{
650 if (event == NETDEV_DOWN) 650 if (event == NETDEV_DOWN)
651 /* Discard any use of this */ 651 /* Discard any use of this */
652 atalk_dev_down(ptr); 652 atalk_dev_down(ptr);
653 653
654 return NOTIFY_DONE; 654 return NOTIFY_DONE;
655} 655}
@@ -701,13 +701,13 @@ static int atif_ioctl(int cmd, void __user *arg)
701 */ 701 */
702 if ((dev->flags & IFF_POINTOPOINT) && 702 if ((dev->flags & IFF_POINTOPOINT) &&
703 atalk_find_interface(sa->sat_addr.s_net, 703 atalk_find_interface(sa->sat_addr.s_net,
704 sa->sat_addr.s_node)) { 704 sa->sat_addr.s_node)) {
705 printk(KERN_DEBUG "AppleTalk: point-to-point " 705 printk(KERN_DEBUG "AppleTalk: point-to-point "
706 "interface added with " 706 "interface added with "
707 "existing address\n"); 707 "existing address\n");
708 add_route = 0; 708 add_route = 0;
709 } 709 }
710 710
711 /* 711 /*
712 * Phase 1 is fine on LocalTalk but we don't do 712 * Phase 1 is fine on LocalTalk but we don't do
713 * EtherTalk phase 1. Anyone wanting to add it go ahead. 713 * EtherTalk phase 1. Anyone wanting to add it go ahead.
@@ -797,78 +797,78 @@ static int atif_ioctl(int cmd, void __user *arg)
797 sa->sat_addr.s_node = ATADDR_BCAST; 797 sa->sat_addr.s_node = ATADDR_BCAST;
798 break; 798 break;
799 799
800 case SIOCATALKDIFADDR: 800 case SIOCATALKDIFADDR:
801 case SIOCDIFADDR: 801 case SIOCDIFADDR:
802 if (!capable(CAP_NET_ADMIN)) 802 if (!capable(CAP_NET_ADMIN))
803 return -EPERM; 803 return -EPERM;
804 if (sa->sat_family != AF_APPLETALK) 804 if (sa->sat_family != AF_APPLETALK)
805 return -EINVAL; 805 return -EINVAL;
806 atalk_dev_down(dev); 806 atalk_dev_down(dev);
807 break; 807 break;
808 808
809 case SIOCSARP: 809 case SIOCSARP:
810 if (!capable(CAP_NET_ADMIN)) 810 if (!capable(CAP_NET_ADMIN))
811 return -EPERM; 811 return -EPERM;
812 if (sa->sat_family != AF_APPLETALK) 812 if (sa->sat_family != AF_APPLETALK)
813 return -EINVAL; 813 return -EINVAL;
814 if (!atif) 814 if (!atif)
815 return -EADDRNOTAVAIL; 815 return -EADDRNOTAVAIL;
816 816
817 /* 817 /*
818 * for now, we only support proxy AARP on ELAP; 818 * for now, we only support proxy AARP on ELAP;
819 * we should be able to do it for LocalTalk, too. 819 * we should be able to do it for LocalTalk, too.
820 */ 820 */
821 if (dev->type != ARPHRD_ETHER) 821 if (dev->type != ARPHRD_ETHER)
822 return -EPROTONOSUPPORT; 822 return -EPROTONOSUPPORT;
823 823
824 /* 824 /*
825 * atif points to the current interface on this network; 825 * atif points to the current interface on this network;
826 * we aren't concerned about its current status (at 826 * we aren't concerned about its current status (at
827 * least for now), but it has all the settings about 827 * least for now), but it has all the settings about
828 * the network we're going to probe. Consequently, it 828 * the network we're going to probe. Consequently, it
829 * must exist. 829 * must exist.
830 */ 830 */
831 if (!atif) 831 if (!atif)
832 return -EADDRNOTAVAIL; 832 return -EADDRNOTAVAIL;
833 833
834 nr = (struct atalk_netrange *)&(atif->nets); 834 nr = (struct atalk_netrange *)&(atif->nets);
835 /* 835 /*
836 * Phase 1 is fine on Localtalk but we don't do 836 * Phase 1 is fine on Localtalk but we don't do
837 * Ethertalk phase 1. Anyone wanting to add it go ahead. 837 * Ethertalk phase 1. Anyone wanting to add it go ahead.
838 */ 838 */
839 if (dev->type == ARPHRD_ETHER && nr->nr_phase != 2) 839 if (dev->type == ARPHRD_ETHER && nr->nr_phase != 2)
840 return -EPROTONOSUPPORT; 840 return -EPROTONOSUPPORT;
841 841
842 if (sa->sat_addr.s_node == ATADDR_BCAST || 842 if (sa->sat_addr.s_node == ATADDR_BCAST ||
843 sa->sat_addr.s_node == 254) 843 sa->sat_addr.s_node == 254)
844 return -EINVAL; 844 return -EINVAL;
845 845
846 /*
847 * Check if the chosen address is used. If so we
848 * error and ATCP will try another.
849 */
850 if (atif_proxy_probe_device(atif, &(sa->sat_addr)) < 0)
851 return -EADDRINUSE;
852
853 /* 846 /*
854 * We now have an address on the local network, and 847 * Check if the chosen address is used. If so we
848 * error and ATCP will try another.
849 */
850 if (atif_proxy_probe_device(atif, &(sa->sat_addr)) < 0)
851 return -EADDRINUSE;
852
853 /*
854 * We now have an address on the local network, and
855 * the AARP code will defend it for us until we take it 855 * the AARP code will defend it for us until we take it
856 * down. We don't set up any routes right now, because 856 * down. We don't set up any routes right now, because
857 * ATCP will install them manually via SIOCADDRT. 857 * ATCP will install them manually via SIOCADDRT.
858 */ 858 */
859 break; 859 break;
860 860
861 case SIOCDARP: 861 case SIOCDARP:
862 if (!capable(CAP_NET_ADMIN)) 862 if (!capable(CAP_NET_ADMIN))
863 return -EPERM; 863 return -EPERM;
864 if (sa->sat_family != AF_APPLETALK) 864 if (sa->sat_family != AF_APPLETALK)
865 return -EINVAL; 865 return -EINVAL;
866 if (!atif) 866 if (!atif)
867 return -EADDRNOTAVAIL; 867 return -EADDRNOTAVAIL;
868 868
869 /* give to aarp module to remove proxy entry */ 869 /* give to aarp module to remove proxy entry */
870 aarp_proxy_remove(atif->dev, &(sa->sat_addr)); 870 aarp_proxy_remove(atif->dev, &(sa->sat_addr));
871 return 0; 871 return 0;
872 } 872 }
873 873
874 return copy_to_user(arg, &atreq, sizeof(atreq)) ? -EFAULT : 0; 874 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 dev = __dev_get_by_name(name); 899 dev = __dev_get_by_name(name);
900 if (!dev) 900 if (!dev)
901 return -ENODEV; 901 return -ENODEV;
902 } 902 }
903 return atrtr_create(&rt, dev); 903 return atrtr_create(&rt, dev);
904 } 904 }
905 } 905 }
@@ -917,7 +917,7 @@ static int atrtr_ioctl(unsigned int cmd, void __user *arg)
917 * Checksum: This is 'optional'. It's quite likely also a good 917 * Checksum: This is 'optional'. It's quite likely also a good
918 * candidate for assembler hackery 8) 918 * candidate for assembler hackery 8)
919 */ 919 */
920static unsigned long atalk_sum_partial(const unsigned char *data, 920static unsigned long atalk_sum_partial(const unsigned char *data,
921 int len, unsigned long sum) 921 int len, unsigned long sum)
922{ 922{
923 /* This ought to be unwrapped neatly. I'll trust gcc for now */ 923 /* 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 if (copy > len) 945 if (copy > len)
946 copy = len; 946 copy = len;
947 sum = atalk_sum_partial(skb->data + offset, copy, sum); 947 sum = atalk_sum_partial(skb->data + offset, copy, sum);
948 if ( (len -= copy) == 0) 948 if ( (len -= copy) == 0)
949 return sum; 949 return sum;
950 950
951 offset += copy; 951 offset += copy;
@@ -1031,7 +1031,7 @@ static int atalk_create(struct socket *sock, int protocol)
1031 1031
1032 /* 1032 /*
1033 * We permit SOCK_DGRAM and RAW is an extension. It is trivial to do 1033 * We permit SOCK_DGRAM and RAW is an extension. It is trivial to do
1034 * and gives you the full ELAP frame. Should be handy for CAP 8) 1034 * and gives you the full ELAP frame. Should be handy for CAP 8)
1035 */ 1035 */
1036 if (sock->type != SOCK_RAW && sock->type != SOCK_DGRAM) 1036 if (sock->type != SOCK_RAW && sock->type != SOCK_DGRAM)
1037 goto out; 1037 goto out;
@@ -1196,14 +1196,14 @@ static int atalk_connect(struct socket *sock, struct sockaddr *uaddr,
1196 1196
1197 if (addr->sat_addr.s_node == ATADDR_BCAST && 1197 if (addr->sat_addr.s_node == ATADDR_BCAST &&
1198 !sock_flag(sk, SOCK_BROADCAST)) { 1198 !sock_flag(sk, SOCK_BROADCAST)) {
1199#if 1 1199#if 1
1200 printk(KERN_WARNING "%s is broken and did not set " 1200 printk(KERN_WARNING "%s is broken and did not set "
1201 "SO_BROADCAST. It will break when 2.2 is " 1201 "SO_BROADCAST. It will break when 2.2 is "
1202 "released.\n", 1202 "released.\n",
1203 current->comm); 1203 current->comm);
1204#else 1204#else
1205 return -EACCES; 1205 return -EACCES;
1206#endif 1206#endif
1207 } 1207 }
1208 1208
1209 if (sock_flag(sk, SOCK_ZAPPED)) 1209 if (sock_flag(sk, SOCK_ZAPPED))
@@ -1260,27 +1260,27 @@ static int atalk_getname(struct socket *sock, struct sockaddr *uaddr,
1260#if defined(CONFIG_IPDDP) || defined(CONFIG_IPDDP_MODULE) 1260#if defined(CONFIG_IPDDP) || defined(CONFIG_IPDDP_MODULE)
1261static __inline__ int is_ip_over_ddp(struct sk_buff *skb) 1261static __inline__ int is_ip_over_ddp(struct sk_buff *skb)
1262{ 1262{
1263 return skb->data[12] == 22; 1263 return skb->data[12] == 22;
1264} 1264}
1265 1265
1266static int handle_ip_over_ddp(struct sk_buff *skb) 1266static int handle_ip_over_ddp(struct sk_buff *skb)
1267{ 1267{
1268 struct net_device *dev = __dev_get_by_name("ipddp0"); 1268 struct net_device *dev = __dev_get_by_name("ipddp0");
1269 struct net_device_stats *stats; 1269 struct net_device_stats *stats;
1270 1270
1271 /* This needs to be able to handle ipddp"N" devices */ 1271 /* This needs to be able to handle ipddp"N" devices */
1272 if (!dev) 1272 if (!dev)
1273 return -ENODEV; 1273 return -ENODEV;
1274 1274
1275 skb->protocol = htons(ETH_P_IP); 1275 skb->protocol = htons(ETH_P_IP);
1276 skb_pull(skb, 13); 1276 skb_pull(skb, 13);
1277 skb->dev = dev; 1277 skb->dev = dev;
1278 skb->h.raw = skb->data; 1278 skb->h.raw = skb->data;
1279 1279
1280 stats = dev->priv; 1280 stats = dev->priv;
1281 stats->rx_packets++; 1281 stats->rx_packets++;
1282 stats->rx_bytes += skb->len + 13; 1282 stats->rx_bytes += skb->len + 13;
1283 netif_rx(skb); /* Send the SKB up to a higher place. */ 1283 netif_rx(skb); /* Send the SKB up to a higher place. */
1284 return 0; 1284 return 0;
1285} 1285}
1286#else 1286#else
@@ -1298,7 +1298,7 @@ static void atalk_route_packet(struct sk_buff *skb, struct net_device *dev,
1298 1298
1299 /* 1299 /*
1300 * Don't route multicast, etc., packets, or packets sent to "this 1300 * Don't route multicast, etc., packets, or packets sent to "this
1301 * network" 1301 * network"
1302 */ 1302 */
1303 if (skb->pkt_type != PACKET_HOST || !ddp->deh_dnet) { 1303 if (skb->pkt_type != PACKET_HOST || !ddp->deh_dnet) {
1304 /* 1304 /*
@@ -1335,8 +1335,8 @@ static void atalk_route_packet(struct sk_buff *skb, struct net_device *dev,
1335 ta.s_node = rt->gateway.s_node; 1335 ta.s_node = rt->gateway.s_node;
1336 } 1336 }
1337 1337
1338 /* Fix up skb->len field */ 1338 /* Fix up skb->len field */
1339 skb_trim(skb, min_t(unsigned int, origlen, 1339 skb_trim(skb, min_t(unsigned int, origlen,
1340 (rt->dev->hard_header_len + 1340 (rt->dev->hard_header_len +
1341 ddp_dl->header_length + (len_hops & 1023)))); 1341 ddp_dl->header_length + (len_hops & 1023))));
1342 1342
@@ -1358,12 +1358,12 @@ static void atalk_route_packet(struct sk_buff *skb, struct net_device *dev,
1358 /* 22 bytes - 12 ether, 2 len, 3 802.2 5 snap */ 1358 /* 22 bytes - 12 ether, 2 len, 3 802.2 5 snap */
1359 struct sk_buff *nskb = skb_realloc_headroom(skb, 32); 1359 struct sk_buff *nskb = skb_realloc_headroom(skb, 32);
1360 kfree_skb(skb); 1360 kfree_skb(skb);
1361 if (!nskb) 1361 if (!nskb)
1362 goto out; 1362 goto out;
1363 skb = nskb; 1363 skb = nskb;
1364 } else 1364 } else
1365 skb = skb_unshare(skb, GFP_ATOMIC); 1365 skb = skb_unshare(skb, GFP_ATOMIC);
1366 1366
1367 /* 1367 /*
1368 * If the buffer didn't vanish into the lack of space bitbucket we can 1368 * If the buffer didn't vanish into the lack of space bitbucket we can
1369 * send it. 1369 * send it.
@@ -1395,13 +1395,13 @@ static int atalk_rcv(struct sk_buff *skb, struct net_device *dev,
1395 struct sock *sock; 1395 struct sock *sock;
1396 struct atalk_iface *atif; 1396 struct atalk_iface *atif;
1397 struct sockaddr_at tosat; 1397 struct sockaddr_at tosat;
1398 int origlen; 1398 int origlen;
1399 __u16 len_hops; 1399 __u16 len_hops;
1400 1400
1401 /* Don't mangle buffer if shared */ 1401 /* Don't mangle buffer if shared */
1402 if (!(skb = skb_share_check(skb, GFP_ATOMIC))) 1402 if (!(skb = skb_share_check(skb, GFP_ATOMIC)))
1403 goto out; 1403 goto out;
1404 1404
1405 /* Size check and make sure header is contiguous */ 1405 /* Size check and make sure header is contiguous */
1406 if (!pskb_may_pull(skb, sizeof(*ddp))) 1406 if (!pskb_may_pull(skb, sizeof(*ddp)))
1407 goto freeit; 1407 goto freeit;
@@ -1490,7 +1490,7 @@ static int ltalk_rcv(struct sk_buff *skb, struct net_device *dev,
1490 goto freeit; 1490 goto freeit;
1491 1491
1492 /* Don't mangle buffer if shared */ 1492 /* Don't mangle buffer if shared */
1493 if (!(skb = skb_share_check(skb, GFP_ATOMIC))) 1493 if (!(skb = skb_share_check(skb, GFP_ATOMIC)))
1494 return 0; 1494 return 0;
1495 1495
1496 /* 1496 /*
@@ -1501,11 +1501,11 @@ static int ltalk_rcv(struct sk_buff *skb, struct net_device *dev,
1501 1501
1502 /* Now fill in the long header */ 1502 /* Now fill in the long header */
1503 1503
1504 /* 1504 /*
1505 * These two first. The mac overlays the new source/dest 1505 * These two first. The mac overlays the new source/dest
1506 * network information so we MUST copy these before 1506 * network information so we MUST copy these before
1507 * we write the network numbers ! 1507 * we write the network numbers !
1508 */ 1508 */
1509 1509
1510 ddp->deh_dnode = skb->mac.raw[0]; /* From physical header */ 1510 ddp->deh_dnode = skb->mac.raw[0]; /* From physical header */
1511 ddp->deh_snode = skb->mac.raw[1]; /* From physical header */ 1511 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 skb = sock_alloc_send_skb(sk, size, (flags & MSG_DONTWAIT), &err); 1605 skb = sock_alloc_send_skb(sk, size, (flags & MSG_DONTWAIT), &err);
1606 if (!skb) 1606 if (!skb)
1607 return err; 1607 return err;
1608 1608
1609 skb->sk = sk; 1609 skb->sk = sk;
1610 skb_reserve(skb, ddp_dl->header_length); 1610 skb_reserve(skb, ddp_dl->header_length);
1611 skb_reserve(skb, dev->hard_header_len); 1611 skb_reserve(skb, dev->hard_header_len);
diff --git a/net/appletalk/dev.c b/net/appletalk/dev.c
index 1237e208e246..9e4dffc1e423 100644
--- a/net/appletalk/dev.c
+++ b/net/appletalk/dev.c
@@ -15,14 +15,14 @@ static int ltalk_change_mtu(struct net_device *dev, int mtu)
15} 15}
16 16
17static int ltalk_mac_addr(struct net_device *dev, void *addr) 17static int ltalk_mac_addr(struct net_device *dev, void *addr)
18{ 18{
19 return -EINVAL; 19 return -EINVAL;
20} 20}
21 21
22static void ltalk_setup(struct net_device *dev) 22static void ltalk_setup(struct net_device *dev)
23{ 23{
24 /* Fill in the fields of the device structure with localtalk-generic values. */ 24 /* Fill in the fields of the device structure with localtalk-generic values. */
25 25
26 dev->change_mtu = ltalk_change_mtu; 26 dev->change_mtu = ltalk_change_mtu;
27 dev->hard_header = NULL; 27 dev->hard_header = NULL;
28 dev->rebuild_header = NULL; 28 dev->rebuild_header = NULL;
@@ -34,8 +34,8 @@ static void ltalk_setup(struct net_device *dev)
34 dev->hard_header_len = LTALK_HLEN; 34 dev->hard_header_len = LTALK_HLEN;
35 dev->mtu = LTALK_MTU; 35 dev->mtu = LTALK_MTU;
36 dev->addr_len = LTALK_ALEN; 36 dev->addr_len = LTALK_ALEN;
37 dev->tx_queue_len = 10; 37 dev->tx_queue_len = 10;
38 38
39 dev->broadcast[0] = 0xFF; 39 dev->broadcast[0] = 0xFF;
40 40
41 dev->flags = IFF_BROADCAST|IFF_MULTICAST|IFF_NOARP; 41 dev->flags = IFF_BROADCAST|IFF_MULTICAST|IFF_NOARP;