X-Git-Url: http://pileus.org/git/?a=blobdiff_plain;f=net%2Fcore%2Fneighbour.c;h=e16129019c6658ae7b1ab697692f8e6484c8cd90;hb=8ab47d3ec77d94ad9a6bb01efd696e1e34cfe80d;hp=b9e9e0d38672a8ca9a17f8d6ec8daf88b8a09a65;hpb=1cd731df09decfc7e9b4b86190efa262851f68e9;p=~andy%2Flinux diff --git a/net/core/neighbour.c b/net/core/neighbour.c index b9e9e0d3867..e16129019c6 100644 --- a/net/core/neighbour.c +++ b/net/core/neighbour.c @@ -766,9 +766,6 @@ static void neigh_periodic_work(struct work_struct *work) nht = rcu_dereference_protected(tbl->nht, lockdep_is_held(&tbl->lock)); - if (atomic_read(&tbl->entries) < tbl->gc_thresh1) - goto out; - /* * periodically recompute ReachableTime from random function */ @@ -781,6 +778,9 @@ static void neigh_periodic_work(struct work_struct *work) neigh_rand_reach_time(NEIGH_VAR(p, BASE_REACHABLE_TIME)); } + if (atomic_read(&tbl->entries) < tbl->gc_thresh1) + goto out; + for (i = 0 ; i < (1 << nht->hash_shift); i++) { np = &nht->hash_buckets[i]; @@ -3046,7 +3046,7 @@ int neigh_sysctl_register(struct net_device *dev, struct neigh_parms *p, if (!t) goto err; - for (i = 0; i < ARRAY_SIZE(t->neigh_vars); i++) { + for (i = 0; i < NEIGH_VAR_GC_INTERVAL; i++) { t->neigh_vars[i].data += (long) p; t->neigh_vars[i].extra1 = dev; t->neigh_vars[i].extra2 = p;