]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - net/core/neighbour.c
Merge tag 'xtensa-20170612' of git://github.com/jcmvbkbc/linux-xtensa
[karo-tx-linux.git] / net / core / neighbour.c
index 58b0bcc125b5559f299dc2f195deccb5c43d0844..d274f81fcc2c08f1e85df4ed00b9a034f3ae0739 100644 (file)
@@ -1132,10 +1132,6 @@ int neigh_update(struct neighbour *neigh, const u8 *lladdr, u8 new,
                lladdr = neigh->ha;
        }
 
-       if (new & NUD_CONNECTED)
-               neigh->confirmed = jiffies;
-       neigh->updated = jiffies;
-
        /* If entry was valid and address is not changed,
           do not change entry state, if new one is STALE.
         */
@@ -1157,6 +1153,16 @@ int neigh_update(struct neighbour *neigh, const u8 *lladdr, u8 new,
                }
        }
 
+       /* Update timestamps only once we know we will make a change to the
+        * neighbour entry. Otherwise we risk to move the locktime window with
+        * noop updates and ignore relevant ARP updates.
+        */
+       if (new != old || lladdr != neigh->ha) {
+               if (new & NUD_CONNECTED)
+                       neigh->confirmed = jiffies;
+               neigh->updated = jiffies;
+       }
+
        if (new != old) {
                neigh_del_timer(neigh);
                if (new & NUD_PROBE)