mirror of
https://github.com/torvalds/linux.git
synced 2026-06-08 14:42:37 +02:00
neigh: recompute reachabletime before returning from neigh_periodic_work()
[ Upstream commit feff9ab2e7 ]
If the neigh table's entries is less than gc_thresh1, the function
will return directly, and the reachabletime will not be recompute,
so the reachabletime can be guessed.
Signed-off-by: Duan Jiong <duanj.fnst@cn.fujitsu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
fe42b170af
commit
913cfa947d
|
|
@ -764,9 +764,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
|
||||
*/
|
||||
|
|
@ -779,6 +776,9 @@ static void neigh_periodic_work(struct work_struct *work)
|
|||
neigh_rand_reach_time(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];
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user