net, neigh: Reject creating NUD_PERMANENT with NTF_MANAGED entries
authorDaniel Borkmann <daniel@iogearbox.net>
Wed, 13 Oct 2021 13:21:40 +0000 (15:21 +0200)
committerJakub Kicinski <kuba@kernel.org>
Fri, 15 Oct 2021 02:16:21 +0000 (19:16 -0700)
commit30fc7efa38f21afa48b0be6bf2053e4c10ae2c78
treeecb461991215ba2658ce6d311ebb87da4a2a78aa
parentc8e80c1169b2b3b91453f9ff3c34687c42233ef7
net, neigh: Reject creating NUD_PERMANENT with NTF_MANAGED entries

The combination of NUD_PERMANENT + NTF_MANAGED is not supported and does
not make sense either given the former indicates a static/fixed neighbor
entry whereas the latter a dynamically resolved one. While it is possible
to transition from one over to the other, we should however reject such
creation attempts.

Fixes: 7482e3841d52 ("net, neigh: Add NTF_MANAGED flag for managed neighbor entries")
Suggested-by: David Ahern <dsahern@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Reviewed-by: David Ahern <dsahern@kernel.org>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/core/neighbour.c