From 65347f0f6b57171b7bb939c91f7e41e49e73edb8 Mon Sep 17 00:00:00 2001 From: Julian Anastasov Date: Tue, 3 Oct 2006 15:49:46 -0700 Subject: [PATCH] --- yaml --- r: 38559 b: refs/heads/master c: c5e29460f5f9eb189cab5d9fdaa137e64f7734b6 h: refs/heads/master i: 38557: 546499a3eddc0c7e06297c8b1697a1c56004f6b8 38555: c597b9603428cbc2fe6bde6f3029328093111c3e 38551: 0f5b3a218e216c49ecbf912237c8aeebf48c48cf 38543: 730442601cc01e5542590901af07ebdfbc013b8c 38527: 12f6d91cef2d9612a56d67b88dcd363b3b052d3b v: v3 --- [refs] | 2 +- trunk/net/core/neighbour.c | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/[refs] b/[refs] index 6ba1eba40323..a0cfec37962e 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 1e0c14f49d6b393179f423abbac47f85618d3d46 +refs/heads/master: c5e29460f5f9eb189cab5d9fdaa137e64f7734b6 diff --git a/trunk/net/core/neighbour.c b/trunk/net/core/neighbour.c index 8ce8c471d868..b4b478353b27 100644 --- a/trunk/net/core/neighbour.c +++ b/trunk/net/core/neighbour.c @@ -344,12 +344,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) & tbl->hash_mask; + u32 hash_val = tbl->hash(pkey, dev); NEIGH_CACHE_STAT_INC(tbl, lookups); read_lock_bh(&tbl->lock); - for (n = tbl->hash_buckets[hash_val]; n; n = n->next) { + 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); NEIGH_CACHE_STAT_INC(tbl, hits); @@ -364,12 +364,12 @@ struct neighbour *neigh_lookup_nodev(struct neigh_table *tbl, const void *pkey) { struct neighbour *n; int key_len = tbl->key_len; - u32 hash_val = tbl->hash(pkey, NULL) & tbl->hash_mask; + u32 hash_val = tbl->hash(pkey, NULL); NEIGH_CACHE_STAT_INC(tbl, lookups); read_lock_bh(&tbl->lock); - for (n = tbl->hash_buckets[hash_val]; n; n = n->next) { + for (n = tbl->hash_buckets[hash_val & tbl->hash_mask]; n; n = n->next) { if (!memcmp(n->primary_key, pkey, key_len)) { neigh_hold(n); NEIGH_CACHE_STAT_INC(tbl, hits); @@ -1998,12 +1998,12 @@ static int neigh_dump_table(struct neigh_table *tbl, struct sk_buff *skb, int rc, h, s_h = cb->args[1]; int idx, s_idx = idx = cb->args[2]; + read_lock_bh(&tbl->lock); for (h = 0; h <= tbl->hash_mask; h++) { if (h < s_h) continue; if (h > s_h) s_idx = 0; - read_lock_bh(&tbl->lock); for (n = tbl->hash_buckets[h], idx = 0; n; n = n->next, idx++) { if (idx < s_idx) continue; @@ -2016,8 +2016,8 @@ static int neigh_dump_table(struct neigh_table *tbl, struct sk_buff *skb, goto out; } } - read_unlock_bh(&tbl->lock); } + read_unlock_bh(&tbl->lock); rc = skb->len; out: cb->args[1] = h;