Page MenuHomeFreeBSD

ndp: Bring back -A option for the netlink implementation
ClosedPublic

Authored by zlei on Oct 22 2024, 11:30 AM.
Tags
None
Referenced Files
F106192930: D47234.diff
Thu, Dec 26, 10:30 PM
Unknown Object (File)
Tue, Dec 10, 1:05 PM
Unknown Object (File)
Mon, Dec 9, 5:10 AM
Unknown Object (File)
Wed, Dec 4, 2:06 PM
Unknown Object (File)
Nov 18 2024, 5:05 PM
Unknown Object (File)
Nov 9 2024, 2:52 AM
Unknown Object (File)
Nov 3 2024, 1:06 AM
Subscribers

Details

Summary

This was lost during the converting to netlink.

Fixes: 91fbe0819bb9 ndp: convert ndp(8) to netlink
MFC after: 1 week

Test Plan

Watching the output of ndp -A1 . Compare the output with rtsock based implementation.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

usr.sbin/ndp/ndp_netlink.c
342

I'm not sure but it seems snl_finalize_msg() and snl_send_message() do not fail.

It's not as straightforward for '-A' as it'd be for other options, but we should look into writing a test case for this too.
Known bugs are an obvious candidate for test cases after all.

I think that something like timeout 5 ndp -A 2 is a good basis to start from. (I.e. ensure we have two copies of the expected neighbour entry).

usr.sbin/ndp/ndp_netlink.c
342

snl_finalize_msg() will return NULL if there's been an error on the snl_writer previously, and snl_send_message() communicates with the kernel, which can pretty much always fail.

So I do think we still need these checks (even if they're pretty unlikely to fail).

389

This results in an empty line between each iteration. On the whole that's probably a good thing, but I don't know if that was also the case before the switch to netlink or not.

This revision is now accepted and ready to land.Oct 22 2024, 4:55 PM
In D47234#1077261, @kp wrote:

It's not as straightforward for '-A' as it'd be for other options, but we should look into writing a test case for this too.
Known bugs are an obvious candidate for test cases after all.

I'll try to make one test case for that.

I think that something like timeout 5 ndp -A 2 is a good basis to start from. (I.e. ensure we have two copies of the expected neighbour entry).

Sounds good.

zlei marked an inline comment as done.Oct 28 2024, 9:00 AM
zlei added inline comments.
usr.sbin/ndp/ndp_netlink.c
389

The original rtsock based implementation has this extra empty line.

This revision was automatically updated to reflect the committed changes.
zlei marked an inline comment as done.