Merge branch 'v3.10/topic/misc' into linux-linaro-lsk
[firefly-linux-kernel-4.4.55.git] / net / core / neighbour.c
index 49aeab86f3177d5862ac9caa6050d25c7f90b91e..b49e8bafab173245779a7acb480a6bf7a120541f 100644 (file)
@@ -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];