[PATCH net v3] neighbour: add RTNL_FLAG_DUMP_SPLIT_NLM_DONE to RTM_GETNEIGH

Carlos Llamas posted 1 patch 2 weeks, 1 day ago
net/core/neighbour.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
[PATCH net v3] neighbour: add RTNL_FLAG_DUMP_SPLIT_NLM_DONE to RTM_GETNEIGH
Posted by Carlos Llamas 2 weeks, 1 day ago
From: Maciej Żenczykowski <maze@google.com>

without this Android's net test, available at:
  https://cs.android.com/android/platform/superproject/main/+/main:kernel/tests/net/test/
run via:
  /...aosp-tests.../net/test/run_net_test.sh --builder neighbour_test.py
fails with:
  TypeError: NLMsgHdr requires a bytes object of length 16, got 4

Fixes: 7e4975f7e7fb ("neighbour: fix neigh_dump_info() return value")
Cc: Jakub Kicinski <kuba@kernel.org>
Cc: Eric Dumazet <edumazet@google.com>
Cc: David S. Miller <davem@davemloft.net>
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Tested-by: Carlos Llamas <cmllamas@google.com>
Signed-off-by: Carlos Llamas <cmllamas@google.com>
---
It seems like this fix slipped through the cracks, so I'm resending it.

v3: Rebased on top of mainline and fixed the conflicts as v2 from Maciej
    no longer applied cleanly. Verified the fix works as explained un
    the commit message. Added tested and sob tags.

 net/core/neighbour.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/net/core/neighbour.c b/net/core/neighbour.c
index c56a4e7bf790..bdee4cf110bd 100644
--- a/net/core/neighbour.c
+++ b/net/core/neighbour.c
@@ -3953,7 +3953,8 @@ static const struct rtnl_msg_handler neigh_rtnl_msg_handlers[] __initconst = {
 	{.msgtype = RTM_NEWNEIGH, .doit = neigh_add},
 	{.msgtype = RTM_DELNEIGH, .doit = neigh_delete},
 	{.msgtype = RTM_GETNEIGH, .doit = neigh_get, .dumpit = neigh_dump_info,
-	 .flags = RTNL_FLAG_DOIT_UNLOCKED | RTNL_FLAG_DUMP_UNLOCKED},
+	 .flags = RTNL_FLAG_DOIT_UNLOCKED | RTNL_FLAG_DUMP_UNLOCKED |
+		  RTNL_FLAG_DUMP_SPLIT_NLM_DONE},
 	{.msgtype = RTM_GETNEIGHTBL, .dumpit = neightbl_dump_info,
 	 .flags = RTNL_FLAG_DUMP_UNLOCKED},
 	{.msgtype = RTM_SETNEIGHTBL, .doit = neightbl_set,
-- 
2.53.0.1018.g2bb0e51243-goog
Re: [PATCH net v3] neighbour: add RTNL_FLAG_DUMP_SPLIT_NLM_DONE to RTM_GETNEIGH
Posted by Maciej Żenczykowski 2 weeks, 1 day ago
This didn't really slip through; rather, the netlink parsing code in
Android's net test is buggy and needs a rework...

On Thu, Mar 19, 2026 at 3:23 PM Carlos Llamas <cmllamas@google.com> wrote:
>
> From: Maciej Żenczykowski <maze@google.com>
>
> without this Android's net test, available at:
>   https://cs.android.com/android/platform/superproject/main/+/main:kernel/tests/net/test/
> run via:
>   /...aosp-tests.../net/test/run_net_test.sh --builder neighbour_test.py
> fails with:
>   TypeError: NLMsgHdr requires a bytes object of length 16, got 4
>
> Fixes: 7e4975f7e7fb ("neighbour: fix neigh_dump_info() return value")
> Cc: Jakub Kicinski <kuba@kernel.org>
> Cc: Eric Dumazet <edumazet@google.com>
> Cc: David S. Miller <davem@davemloft.net>
> Signed-off-by: Maciej Żenczykowski <maze@google.com>
> Tested-by: Carlos Llamas <cmllamas@google.com>
> Signed-off-by: Carlos Llamas <cmllamas@google.com>
> ---
> It seems like this fix slipped through the cracks, so I'm resending it.
>
> v3: Rebased on top of mainline and fixed the conflicts as v2 from Maciej
>     no longer applied cleanly. Verified the fix works as explained un
>     the commit message. Added tested and sob tags.
>
>  net/core/neighbour.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/net/core/neighbour.c b/net/core/neighbour.c
> index c56a4e7bf790..bdee4cf110bd 100644
> --- a/net/core/neighbour.c
> +++ b/net/core/neighbour.c
> @@ -3953,7 +3953,8 @@ static const struct rtnl_msg_handler neigh_rtnl_msg_handlers[] __initconst = {
>         {.msgtype = RTM_NEWNEIGH, .doit = neigh_add},
>         {.msgtype = RTM_DELNEIGH, .doit = neigh_delete},
>         {.msgtype = RTM_GETNEIGH, .doit = neigh_get, .dumpit = neigh_dump_info,
> -        .flags = RTNL_FLAG_DOIT_UNLOCKED | RTNL_FLAG_DUMP_UNLOCKED},
> +        .flags = RTNL_FLAG_DOIT_UNLOCKED | RTNL_FLAG_DUMP_UNLOCKED |
> +                 RTNL_FLAG_DUMP_SPLIT_NLM_DONE},
>         {.msgtype = RTM_GETNEIGHTBL, .dumpit = neightbl_dump_info,
>          .flags = RTNL_FLAG_DUMP_UNLOCKED},
>         {.msgtype = RTM_SETNEIGHTBL, .doit = neightbl_set,
> --
> 2.53.0.1018.g2bb0e51243-goog
>