Re: [PATCH net v3] neighbour: add RTNL_FLAG_DUMP_SPLIT_NLM_DONE to RTM_GETNEIGH

From: Maciej Żenczykowski

Date: Fri Mar 20 2026 - 01:56:04 EST


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@xxxxxxxxxx> wrote:
>
> From: Maciej Żenczykowski <maze@xxxxxxxxxx>
>
> 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@xxxxxxxxxx>
> Cc: Eric Dumazet <edumazet@xxxxxxxxxx>
> Cc: David S. Miller <davem@xxxxxxxxxxxxx>
> Signed-off-by: Maciej Żenczykowski <maze@xxxxxxxxxx>
> Tested-by: Carlos Llamas <cmllamas@xxxxxxxxxx>
> Signed-off-by: Carlos Llamas <cmllamas@xxxxxxxxxx>
> ---
> 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
>