Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit feff9ab2 authored by Duan Jiong's avatar Duan Jiong Committed by David S. Miller
Browse files

neigh: recompute reachabletime before returning from neigh_periodic_work()



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: default avatarDuan Jiong <duanj.fnst@cn.fujitsu.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 352063c8
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -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];