Skip to content

Commit 0e7bbcc

Browse files
Julian Anastasovdavem330
authored andcommitted
neigh: allow admin to set NUD_STALE
Admin should be able to set any state. Currently, this fails when lladdr is not changed and state is changed from NUD_CONNECTED to NUD_STALE: ip neigh add 192.168.8.1 lladdr 00:11:22:33:44:55 nud perm dev wlan0 ip neigh show to 192.168.8.1 192.168.8.1 dev wlan0 lladdr 00:11:22:33:44:55 PERMANENT ip neigh change 192.168.8.1 lladdr 00:11:22:33:44:55 nud stale dev wlan0 ip neigh show to 192.168.8.1 192.168.8.1 dev wlan0 lladdr 00:11:22:33:44:55 PERMANENT Problem may be from 2.1.X days. Signed-off-by: Julian Anastasov <[email protected]> Reviewed-by: Chunhui He <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 1fe323a commit 0e7bbcc

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

net/core/neighbour.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1148,7 +1148,8 @@ int neigh_update(struct neighbour *neigh, const u8 *lladdr, u8 new,
11481148
} else
11491149
goto out;
11501150
} else {
1151-
if (lladdr == neigh->ha && new == NUD_STALE)
1151+
if (lladdr == neigh->ha && new == NUD_STALE &&
1152+
!(flags & NEIGH_UPDATE_F_ADMIN))
11521153
new = old;
11531154
}
11541155
}

0 commit comments

Comments
 (0)