diff options
author | Ralf Baechle <ralf@linux-mips.org> | 1999-02-15 02:15:32 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 1999-02-15 02:15:32 +0000 |
commit | 86464aed71025541805e7b1515541aee89879e33 (patch) | |
tree | e01a457a4912a8553bc65524aa3125d51f29f810 /net/appletalk | |
parent | 88f99939ecc6a95a79614574cb7d95ffccfc3466 (diff) |
Merge with Linux 2.2.1.
Diffstat (limited to 'net/appletalk')
-rw-r--r-- | net/appletalk/aarp.c | 2 | ||||
-rw-r--r-- | net/appletalk/ddp.c | 32 |
2 files changed, 27 insertions, 7 deletions
diff --git a/net/appletalk/aarp.c b/net/appletalk/aarp.c index 74540951f..6d59b2338 100644 --- a/net/appletalk/aarp.c +++ b/net/appletalk/aarp.c @@ -294,7 +294,7 @@ static void aarp_expire_timer(struct aarp_entry **n) while((*n)!=NULL) { /* Expired ? */ - if((*n)->expires_at < jiffies) + if(time_after(jiffies, (*n)->expires_at)) { t= *n; *n=(*n)->next; diff --git a/net/appletalk/ddp.c b/net/appletalk/ddp.c index c79fc6874..735825842 100644 --- a/net/appletalk/ddp.c +++ b/net/appletalk/ddp.c @@ -31,12 +31,19 @@ * AppleTalk drivers, cleaned it. * Rob Newberry : Added proxy AARP and AARP proc fs, * moved probing to AARP module. + * Adrian Sun/ + * Michael Zuelsdorff : fix for net.0 packets. don't + * allow illegal ether/tokentalk + * port assignment. we lose a + * valid localtalk port as a + * result. + * * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. - * + * */ #include <linux/config.h> @@ -141,7 +148,7 @@ static struct sock *atalk_search_socket(struct sockaddr_at *to, struct atalk_ifa continue; } - if(to->sat_addr.s_net == 0 + if(to->sat_addr.s_net == ATADDR_ANYNET && to->sat_addr.s_node == ATADDR_BCAST && s->protinfo.af_at.src_net == atif->address.s_net) { @@ -156,7 +163,14 @@ static struct sock *atalk_search_socket(struct sockaddr_at *to, struct atalk_ifa break; } - /* XXXX.0 */ + /* XXXX.0 -- we got a request for this router. make sure + * that the node is appropriately set. */ + if (to->sat_addr.s_node == ATADDR_ANYNODE && + to->sat_addr.s_net != ATADDR_ANYNET && + atif->address.s_node == s->protinfo.af_at.src_node) { + to->sat_addr.s_node = atif->address.s_node; + break; + } } return (s); @@ -502,6 +516,12 @@ static struct atalk_iface *atalk_find_interface(int net, int node) && iface->address.s_net==net && !(iface->status & ATIF_PROBE)) return (iface); + + /* XXXX.0 -- net.0 returns the iface associated with net */ + if ((node==ATADDR_ANYNODE) && (net != ATADDR_ANYNET) && + (ntohs(iface->nets.nr_firstnet) <= ntohs(net)) && + (ntohs(net) <= ntohs(iface->nets.nr_lastnet))) + return (iface); } return (NULL); @@ -912,7 +932,7 @@ int atif_ioctl(int cmd, void *arg) break; case SIOCSARP: - if(!suser()) + if(!capable(CAP_NET_ADMIN)) return (-EPERM); if(sa->sat_family != AF_APPLETALK) return (-EINVAL); @@ -961,7 +981,7 @@ int atif_ioctl(int cmd, void *arg) break; case SIOCDARP: - if(!suser()) + if(!capable(CAP_NET_ADMIN)) return (-EPERM); if(sa->sat_family != AF_APPLETALK) return (-EINVAL); @@ -2134,7 +2154,7 @@ __initfunc(void atalk_proto_init(struct net_proto *pro)) atalk_register_sysctl(); #endif /* CONFIG_SYSCTL */ - printk(KERN_INFO "AppleTalk 0.18 for Linux NET3.037\n"); + printk(KERN_INFO "NET4: AppleTalk 0.18 for Linux NET4.0\n"); } #ifdef MODULE |