]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/3.10.34/neigh-recompute-reachabletime-before-returning-from-neigh_periodic_work.patch
4.9-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 3.10.34 / neigh-recompute-reachabletime-before-returning-from-neigh_periodic_work.patch
1 From foo@baz Wed Mar 19 23:28:23 Local time zone must be set--see zic manual page 2014
2 From: Duan Jiong <duanj.fnst@cn.fujitsu.com>
3 Date: Thu, 27 Feb 2014 17:14:41 +0800
4 Subject: neigh: recompute reachabletime before returning from neigh_periodic_work()
5
6 From: Duan Jiong <duanj.fnst@cn.fujitsu.com>
7
8 [ Upstream commit feff9ab2e7fa773b6a3965f77375fe89f7fd85cf ]
9
10 If the neigh table's entries is less than gc_thresh1, the function
11 will return directly, and the reachabletime will not be recompute,
12 so the reachabletime can be guessed.
13
14 Signed-off-by: Duan Jiong <duanj.fnst@cn.fujitsu.com>
15 Signed-off-by: David S. Miller <davem@davemloft.net>
16 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
17 ---
18 net/core/neighbour.c | 6 +++---
19 1 file changed, 3 insertions(+), 3 deletions(-)
20
21 --- a/net/core/neighbour.c
22 +++ b/net/core/neighbour.c
23 @@ -764,9 +764,6 @@ static void neigh_periodic_work(struct w
24 nht = rcu_dereference_protected(tbl->nht,
25 lockdep_is_held(&tbl->lock));
26
27 - if (atomic_read(&tbl->entries) < tbl->gc_thresh1)
28 - goto out;
29 -
30 /*
31 * periodically recompute ReachableTime from random function
32 */
33 @@ -779,6 +776,9 @@ static void neigh_periodic_work(struct w
34 neigh_rand_reach_time(p->base_reachable_time);
35 }
36
37 + if (atomic_read(&tbl->entries) < tbl->gc_thresh1)
38 + goto out;
39 +
40 for (i = 0 ; i < (1 << nht->hash_shift); i++) {
41 np = &nht->hash_buckets[i];
42