Merge tag 'edac_updates_for_v5.12' of git://git.kernel.org/pub/scm/linux/kernel/git...
[linux-2.6-microblaze.git] / net / core / neighbour.c
index 277ed85..e2982b3 100644 (file)
@@ -41,7 +41,6 @@
 
 #include <trace/events/neigh.h>
 
-#define DEBUG
 #define NEIGH_DEBUG 1
 #define neigh_dbg(level, fmt, ...)             \
 do {                                           \
@@ -1245,13 +1244,14 @@ static int __neigh_update(struct neighbour *neigh, const u8 *lladdr,
        old    = neigh->nud_state;
        err    = -EPERM;
 
-       if (!(flags & NEIGH_UPDATE_F_ADMIN) &&
-           (old & (NUD_NOARP | NUD_PERMANENT)))
-               goto out;
        if (neigh->dead) {
                NL_SET_ERR_MSG(extack, "Neighbor entry is now dead");
+               new = old;
                goto out;
        }
+       if (!(flags & NEIGH_UPDATE_F_ADMIN) &&
+           (old & (NUD_NOARP | NUD_PERMANENT)))
+               goto out;
 
        ext_learn_change = neigh_update_ext_learned(neigh, flags, &notify);