From a331eb2b3aad563b2bff16edb46a8681060e1b4d Mon Sep 17 00:00:00 2001 From: Pavel Emelyanov Date: Sat, 23 Feb 2008 19:57:02 -0800 Subject: [PATCH] --- yaml --- r: 86299 b: refs/heads/master c: bc4bf5f38cf0a623e6a29f52ec80bfcc56a373c6 h: refs/heads/master i: 86297: f0cc400710b7380a26df703f0b57eb3e82092912 86295: 4d2d4d5fa679bc76f9659c7259a8c91ab8cb48fc v: v3 --- [refs] | 2 +- trunk/net/core/neighbour.c | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index 5ae3d4cc79cd..8e7abc8bcec8 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 1840bb13c22f5b8fd2e242e36c8d6ea3f312be67 +refs/heads/master: bc4bf5f38cf0a623e6a29f52ec80bfcc56a373c6 diff --git a/trunk/net/core/neighbour.c b/trunk/net/core/neighbour.c index 4062b88bfc1b..2328acbd16cd 100644 --- a/trunk/net/core/neighbour.c +++ b/trunk/net/core/neighbour.c @@ -358,11 +358,12 @@ struct neighbour *neigh_lookup(struct neigh_table *tbl, const void *pkey, { struct neighbour *n; int key_len = tbl->key_len; - u32 hash_val = tbl->hash(pkey, dev); + u32 hash_val; NEIGH_CACHE_STAT_INC(tbl, lookups); read_lock_bh(&tbl->lock); + hash_val = tbl->hash(pkey, dev); for (n = tbl->hash_buckets[hash_val & tbl->hash_mask]; n; n = n->next) { if (dev == n->dev && !memcmp(n->primary_key, pkey, key_len)) { neigh_hold(n); @@ -379,11 +380,12 @@ struct neighbour *neigh_lookup_nodev(struct neigh_table *tbl, struct net *net, { struct neighbour *n; int key_len = tbl->key_len; - u32 hash_val = tbl->hash(pkey, NULL); + u32 hash_val; NEIGH_CACHE_STAT_INC(tbl, lookups); read_lock_bh(&tbl->lock); + hash_val = tbl->hash(pkey, NULL); for (n = tbl->hash_buckets[hash_val & tbl->hash_mask]; n; n = n->next) { if (!memcmp(n->primary_key, pkey, key_len) && (net == n->dev->nd_net)) {