aboutsummaryrefslogtreecommitdiffstats
path: root/net/appletalk/aarp.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/appletalk/aarp.c')
-rw-r--r--net/appletalk/aarp.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/net/appletalk/aarp.c b/net/appletalk/aarp.c
index 3d1655f98388..6c5c6dc098ec 100644
--- a/net/appletalk/aarp.c
+++ b/net/appletalk/aarp.c
@@ -330,15 +330,19 @@ static void aarp_expire_timeout(unsigned long unused)
330static int aarp_device_event(struct notifier_block *this, unsigned long event, 330static int aarp_device_event(struct notifier_block *this, unsigned long event,
331 void *ptr) 331 void *ptr)
332{ 332{
333 struct net_device *dev = ptr;
333 int ct; 334 int ct;
334 335
336 if (dev->nd_net != &init_net)
337 return NOTIFY_DONE;
338
335 if (event == NETDEV_DOWN) { 339 if (event == NETDEV_DOWN) {
336 write_lock_bh(&aarp_lock); 340 write_lock_bh(&aarp_lock);
337 341
338 for (ct = 0; ct < AARP_HASH_SIZE; ct++) { 342 for (ct = 0; ct < AARP_HASH_SIZE; ct++) {
339 __aarp_expire_device(&resolved[ct], ptr); 343 __aarp_expire_device(&resolved[ct], dev);
340 __aarp_expire_device(&unresolved[ct], ptr); 344 __aarp_expire_device(&unresolved[ct], dev);
341 __aarp_expire_device(&proxies[ct], ptr); 345 __aarp_expire_device(&proxies[ct], dev);
342 } 346 }
343 347
344 write_unlock_bh(&aarp_lock); 348 write_unlock_bh(&aarp_lock);
@@ -712,6 +716,9 @@ static int aarp_rcv(struct sk_buff *skb, struct net_device *dev,
712 struct atalk_addr sa, *ma, da; 716 struct atalk_addr sa, *ma, da;
713 struct atalk_iface *ifa; 717 struct atalk_iface *ifa;
714 718
719 if (dev->nd_net != &init_net)
720 goto out0;
721
715 /* We only do Ethernet SNAP AARP. */ 722 /* We only do Ethernet SNAP AARP. */
716 if (dev->type != ARPHRD_ETHER) 723 if (dev->type != ARPHRD_ETHER)
717 goto out0; 724 goto out0;
@@ -815,8 +822,6 @@ static int aarp_rcv(struct sk_buff *skb, struct net_device *dev,
815 * address. So as a precaution flush any 822 * address. So as a precaution flush any
816 * entries we have for this address. 823 * entries we have for this address.
817 */ 824 */
818 struct aarp_entry *a;
819
820 a = __aarp_find_entry(resolved[sa.s_node % 825 a = __aarp_find_entry(resolved[sa.s_node %
821 (AARP_HASH_SIZE - 1)], 826 (AARP_HASH_SIZE - 1)],
822 skb->dev, &sa); 827 skb->dev, &sa);
@@ -990,6 +995,7 @@ static int aarp_seq_show(struct seq_file *seq, void *v)
990 struct aarp_iter_state *iter = seq->private; 995 struct aarp_iter_state *iter = seq->private;
991 struct aarp_entry *entry = v; 996 struct aarp_entry *entry = v;
992 unsigned long now = jiffies; 997 unsigned long now = jiffies;
998 DECLARE_MAC_BUF(mac);
993 999
994 if (v == SEQ_START_TOKEN) 1000 if (v == SEQ_START_TOKEN)
995 seq_puts(seq, 1001 seq_puts(seq,
@@ -1000,13 +1006,7 @@ static int aarp_seq_show(struct seq_file *seq, void *v)
1000 ntohs(entry->target_addr.s_net), 1006 ntohs(entry->target_addr.s_net),
1001 (unsigned int) entry->target_addr.s_node, 1007 (unsigned int) entry->target_addr.s_node,
1002 entry->dev ? entry->dev->name : "????"); 1008 entry->dev ? entry->dev->name : "????");
1003 seq_printf(seq, "%02X:%02X:%02X:%02X:%02X:%02X", 1009 seq_printf(seq, "%s", print_mac(mac, entry->hwaddr));
1004 entry->hwaddr[0] & 0xFF,
1005 entry->hwaddr[1] & 0xFF,
1006 entry->hwaddr[2] & 0xFF,
1007 entry->hwaddr[3] & 0xFF,
1008 entry->hwaddr[4] & 0xFF,
1009 entry->hwaddr[5] & 0xFF);
1010 seq_printf(seq, " %8s", 1010 seq_printf(seq, " %8s",
1011 dt2str((long)entry->expires_at - (long)now)); 1011 dt2str((long)entry->expires_at - (long)now));
1012 if (iter->table == unresolved) 1012 if (iter->table == unresolved)