[PATCH] sysctl: make sure that /proc/sys/net/ipv4 appears before per-ns ones
[safe/jmp/linux-2.6] / net / ipv4 / arp.c
index 418862f..b043eda 100644 (file)
@@ -1,7 +1,5 @@
 /* linux/net/ipv4/arp.c
  *
- * Version:    $Id: arp.c,v 1.99 2001/08/30 22:55:42 davem Exp $
- *
  * Copyright (C) 1994 by Florian  La Roche
  *
  * This module implements the Address Resolution Protocol ARP (RFC 826),
@@ -423,11 +421,12 @@ static int arp_filter(__be32 sip, __be32 tip, struct net_device *dev)
        struct rtable *rt;
        int flag = 0;
        /*unsigned long now; */
+       struct net *net = dev_net(dev);
 
-       if (ip_route_output_key(dev_net(dev), &rt, &fl) < 0)
+       if (ip_route_output_key(net, &rt, &fl) < 0)
                return 1;
        if (rt->u.dst.dev != dev) {
-               NET_INC_STATS_BH(LINUX_MIB_ARPFILTER);
+               NET_INC_STATS_BH(net, LINUX_MIB_ARPFILTER);
                flag = 1;
        }
        ip_rt_put(rt);
@@ -1199,7 +1198,7 @@ static int arp_netdev_event(struct notifier_block *this, unsigned long event, vo
        switch (event) {
        case NETDEV_CHANGEADDR:
                neigh_changeaddr(&arp_tbl, dev);
-               rt_cache_flush(0);
+               rt_cache_flush(dev_net(dev), 0);
                break;
        default:
                break;
@@ -1288,7 +1287,6 @@ static void arp_format_neigh_entry(struct seq_file *seq,
                                   struct neighbour *n)
 {
        char hbuffer[HBUFFERLEN];
-       const char hexbuf[] = "0123456789ABCDEF";
        int k, j;
        char tbuf[16];
        struct net_device *dev = n->dev;
@@ -1302,8 +1300,8 @@ static void arp_format_neigh_entry(struct seq_file *seq,
        else {
 #endif
        for (k = 0, j = 0; k < HBUFFERLEN - 3 && j < dev->addr_len; j++) {
-               hbuffer[k++] = hexbuf[(n->ha[j] >> 4) & 15];
-               hbuffer[k++] = hexbuf[n->ha[j] & 15];
+               hbuffer[k++] = hex_asc_hi(n->ha[j]);
+               hbuffer[k++] = hex_asc_lo(n->ha[j]);
                hbuffer[k++] = ':';
        }
        hbuffer[--k] = 0;