]> git.ipfire.org Git - thirdparty/linux.git/commit
neighbour: Move two validations from neigh_get() to neigh_valid_get_req().
authorKuniyuki Iwashima <kuniyu@google.com>
Wed, 16 Jul 2025 22:08:07 +0000 (22:08 +0000)
committerJakub Kicinski <kuba@kernel.org>
Thu, 17 Jul 2025 23:25:20 +0000 (16:25 -0700)
commitf5046fbc1b6d8c5168d47a617f368f9d4a025e34
tree7c1e23982c7b0f4b35f5ede4b049e2d2b4ed08d9
parentcaf0a753a8eb7ca2b035e199b71a3dabb853a18a
neighbour: Move two validations from neigh_get() to neigh_valid_get_req().

We will remove RTNL for neigh_get() and run it under RCU instead.

neigh_get() returns -EINVAL in the following cases:

  * NDA_DST is not specified
  * Both ndm->ndm_ifindex and NTF_PROXY are not specified

These validations do not require RCU.

Let's move them to neigh_valid_get_req().

While at it, the extack string for the first case is replaced with
NL_SET_ERR_ATTR_MISS().

Signed-off-by: Kuniyuki Iwashima <kuniyu@google.com>
Link: https://patch.msgid.link/20250716221221.442239-3-kuniyu@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/core/neighbour.c