neigh: support smaller retrans_time settting
[sfrench/cifs-2.6.git] / net / core / neighbour.c
index 5bf8d22a47ec0d6e1c3385ce5bd26e45f7b6510f..39d37d0ef575bf38eb1219c476970ddab333a176 100644 (file)
@@ -1065,11 +1065,12 @@ static void neigh_timer_handler(struct timer_list *t)
                        neigh->updated = jiffies;
                        atomic_set(&neigh->probes, 0);
                        notify = 1;
-                       next = now + NEIGH_VAR(neigh->parms, RETRANS_TIME);
+                       next = now + max(NEIGH_VAR(neigh->parms, RETRANS_TIME),
+                                        HZ/100);
                }
        } else {
                /* NUD_PROBE|NUD_INCOMPLETE */
-               next = now + NEIGH_VAR(neigh->parms, RETRANS_TIME);
+               next = now + max(NEIGH_VAR(neigh->parms, RETRANS_TIME), HZ/100);
        }
 
        if ((neigh->nud_state & (NUD_INCOMPLETE | NUD_PROBE)) &&
@@ -1125,7 +1126,7 @@ int __neigh_event_send(struct neighbour *neigh, struct sk_buff *skb)
                        neigh->nud_state     = NUD_INCOMPLETE;
                        neigh->updated = now;
                        next = now + max(NEIGH_VAR(neigh->parms, RETRANS_TIME),
-                                        HZ/2);
+                                        HZ/100);
                        neigh_add_timer(neigh, next);
                        immediate_probe = true;
                } else {
@@ -1427,7 +1428,8 @@ void __neigh_set_probe_once(struct neighbour *neigh)
        neigh->nud_state = NUD_INCOMPLETE;
        atomic_set(&neigh->probes, neigh_max_probes(neigh));
        neigh_add_timer(neigh,
-                       jiffies + NEIGH_VAR(neigh->parms, RETRANS_TIME));
+                       jiffies + max(NEIGH_VAR(neigh->parms, RETRANS_TIME),
+                                     HZ/100));
 }
 EXPORT_SYMBOL(__neigh_set_probe_once);