Merge tag 'for-5.4/libata-2019-09-15' of git://git.kernel.dk/linux-block
[linux-2.6-microblaze.git] / net / core / neighbour.c
index 9e7fc92..f79e61c 100644 (file)
@@ -583,6 +583,8 @@ static struct neighbour *___neigh_create(struct neigh_table *tbl,
        int error;
        struct neigh_hash_table *nht;
 
+       trace_neigh_create(tbl, dev, pkey, n, exempt_from_gc);
+
        if (!n) {
                rc = ERR_PTR(-ENOBUFS);
                goto out;
@@ -1122,6 +1124,7 @@ int __neigh_event_send(struct neighbour *neigh, struct sk_buff *skb)
 
                        atomic_set(&neigh->probes,
                                   NEIGH_VAR(neigh->parms, UCAST_PROBES));
+                       neigh_del_timer(neigh);
                        neigh->nud_state     = NUD_INCOMPLETE;
                        neigh->updated = now;
                        next = now + max(NEIGH_VAR(neigh->parms, RETRANS_TIME),
@@ -1138,6 +1141,7 @@ int __neigh_event_send(struct neighbour *neigh, struct sk_buff *skb)
                }
        } else if (neigh->nud_state & NUD_STALE) {
                neigh_dbg(2, "neigh %p is delayed\n", neigh);
+               neigh_del_timer(neigh);
                neigh->nud_state = NUD_DELAY;
                neigh->updated = jiffies;
                neigh_add_timer(neigh, jiffies +
@@ -3372,8 +3376,6 @@ void neigh_app_ns(struct neighbour *n)
 EXPORT_SYMBOL(neigh_app_ns);
 
 #ifdef CONFIG_SYSCTL
-static int zero;
-static int int_max = INT_MAX;
 static int unres_qlen_max = INT_MAX / SKB_TRUESIZE(ETH_FRAME_LEN);
 
 static int proc_unres_qlen(struct ctl_table *ctl, int write,
@@ -3382,7 +3384,7 @@ static int proc_unres_qlen(struct ctl_table *ctl, int write,
        int size, ret;
        struct ctl_table tmp = *ctl;
 
-       tmp.extra1 = &zero;
+       tmp.extra1 = SYSCTL_ZERO;
        tmp.extra2 = &unres_qlen_max;
        tmp.data = &size;
 
@@ -3447,8 +3449,8 @@ static int neigh_proc_dointvec_zero_intmax(struct ctl_table *ctl, int write,
        struct ctl_table tmp = *ctl;
        int ret;
 
-       tmp.extra1 = &zero;
-       tmp.extra2 = &int_max;
+       tmp.extra1 = SYSCTL_ZERO;
+       tmp.extra2 = SYSCTL_INT_MAX;
 
        ret = proc_dointvec_minmax(&tmp, write, buffer, lenp, ppos);
        neigh_proc_update(ctl, write);
@@ -3593,24 +3595,24 @@ static struct neigh_sysctl_table {
                        .procname       = "gc_thresh1",
                        .maxlen         = sizeof(int),
                        .mode           = 0644,
-                       .extra1         = &zero,
-                       .extra2         = &int_max,
+                       .extra1         = SYSCTL_ZERO,
+                       .extra2         = SYSCTL_INT_MAX,
                        .proc_handler   = proc_dointvec_minmax,
                },
                [NEIGH_VAR_GC_THRESH2] = {
                        .procname       = "gc_thresh2",
                        .maxlen         = sizeof(int),
                        .mode           = 0644,
-                       .extra1         = &zero,
-                       .extra2         = &int_max,
+                       .extra1         = SYSCTL_ZERO,
+                       .extra2         = SYSCTL_INT_MAX,
                        .proc_handler   = proc_dointvec_minmax,
                },
                [NEIGH_VAR_GC_THRESH3] = {
                        .procname       = "gc_thresh3",
                        .maxlen         = sizeof(int),
                        .mode           = 0644,
-                       .extra1         = &zero,
-                       .extra2         = &int_max,
+                       .extra1         = SYSCTL_ZERO,
+                       .extra2         = SYSCTL_INT_MAX,
                        .proc_handler   = proc_dointvec_minmax,
                },
                {},