Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 86299
b: refs/heads/master
c: bc4bf5f
h: refs/heads/master
i:
  86297: f0cc400
  86295: 4d2d4d5
v: v3
  • Loading branch information
Pavel Emelyanov authored and David S. Miller committed Feb 24, 2008
1 parent 897c5ef commit a331eb2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 1840bb13c22f5b8fd2e242e36c8d6ea3f312be67
refs/heads/master: bc4bf5f38cf0a623e6a29f52ec80bfcc56a373c6
6 changes: 4 additions & 2 deletions trunk/net/core/neighbour.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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)) {
Expand Down

0 comments on commit a331eb2

Please sign in to comment.