On Fri, 24 Oct 2025 15:03:38 +1100
David Gibson
On Thu, Oct 23, 2025 at 09:29:25PM -0400, Jon Maloy wrote:
The solution to bug https://bugs.passt.top/show_bug.cgi?id=120 requires the ability to translate from an IP address to its corresponding MAC address in cases where those are present in the ARP or NDP tables.
To keep track of the contents of these tables we add a netlink based neighbour subscription feature.
Signed-off-by: Jon Maloy
Reviewed-by: David Gibson
Though one nit [snip]
+ if (!(ndm->ndm_state & NUD_VALID)) { + trace("neighbour notifier: %s unreachable, state: 0x%02x", + ip_str, ndm->ndm_state);
nd_state is a u16, so should that be 0x%04x?
My bad :( that was my suggestion. This is a mistake I keep doing over the years, for some reason, with apparently no fix in sight: if I see 16 bits, I think of "two things" and write %02x. I don't have a problem with 128, 64, 32 or 8 bits, just with 16. I'm finally catching this sometimes if I'm writing code, but catching this while reviewing others' code is probably a different challenge. I can fix this up on merge if that's the only thing that needs to be fixed (I didn't start reviewing yet). -- Stefano