]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - net/ipv4/arp.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc
[net-next-2.6.git] / net / ipv4 / arp.c
index 4083c186fd304a55ed1a5d446371eda1d2661b2f..d8e540c5b0710327fd44c8f269eb51e6fcfedfc5 100644 (file)
@@ -127,7 +127,7 @@ EXPORT_SYMBOL(clip_tbl_hook);
 /*
  *     Interface to generic neighbour cache.
  */
-static u32 arp_hash(const void *pkey, const struct net_device *dev);
+static u32 arp_hash(const void *pkey, const struct net_device *dev, __u32 rnd);
 static int arp_constructor(struct neighbour *neigh);
 static void arp_solicit(struct neighbour *neigh, struct sk_buff *skb);
 static void arp_error_report(struct neighbour *neigh, struct sk_buff *skb);
@@ -161,7 +161,7 @@ static const struct neigh_ops arp_direct_ops = {
        .queue_xmit =           dev_queue_xmit,
 };
 
-const struct neigh_ops arp_broken_ops = {
+static const struct neigh_ops arp_broken_ops = {
        .family =               AF_INET,
        .solicit =              arp_solicit,
        .error_report =         arp_error_report,
@@ -170,7 +170,6 @@ const struct neigh_ops arp_broken_ops = {
        .hh_output =            dev_queue_xmit,
        .queue_xmit =           dev_queue_xmit,
 };
-EXPORT_SYMBOL(arp_broken_ops);
 
 struct neigh_table arp_tbl = {
        .family         = AF_INET,
@@ -226,9 +225,11 @@ int arp_mc_map(__be32 addr, u8 *haddr, struct net_device *dev, int dir)
 }
 
 
-static u32 arp_hash(const void *pkey, const struct net_device *dev)
+static u32 arp_hash(const void *pkey,
+                   const struct net_device *dev,
+                   __u32 hash_rnd)
 {
-       return jhash_2words(*(u32 *)pkey, dev->ifindex, arp_tbl.hash_rnd);
+       return jhash_2words(*(u32 *)pkey, dev->ifindex, hash_rnd);
 }
 
 static int arp_constructor(struct neighbour *neigh)
@@ -501,10 +502,8 @@ int arp_find(unsigned char *haddr, struct sk_buff *skb)
 
        if (n) {
                n->used = jiffies;
-               if (n->nud_state&NUD_VALID || neigh_event_send(n, skb) == 0) {
-                       read_lock_bh(&n->lock);
-                       memcpy(haddr, n->ha, dev->addr_len);
-                       read_unlock_bh(&n->lock);
+               if (n->nud_state & NUD_VALID || neigh_event_send(n, skb) == 0) {
+                       neigh_ha_snapshot(haddr, n, dev);
                        neigh_release(n);
                        return 0;
                }