On Thu, Jun 12, 2025 at 05:17:05PM +0200, Stefano Brivio wrote: > On Thu, 12 Jun 2025 00:21:45 -0400 > Jon Maloy wrote: > > > The solution to bug #120 requires the ability to translate from > > an IP address to its corresponding MAC address in cases where > > those are present in the ARP/NTP table. > > Nit: NDP. > > > We add this feature here. > > > > Signed-off-by: Jon Maloy > > Nit: David's address is david@gibson.dropbear.id.au (in case you need > to Cc: him specifically). Yes, thanks. [snip] > > + if (IN6_IS_ADDR_V4MAPPED(&addr->a6)) { inany_v4() exists for exactly this sort of case. It will both test if the address is a v4 address, and extract it if so, so you shouldn't need to poke into the innards of union inany_addr. > > + ip = &addr->v4mapped.a4; > > + alen = sizeof(struct in_addr); > > + req.ndm.ndm_family = AF_INET; > > + } else { > > + ip = &addr->a6; > > + alen = sizeof(struct in6_addr); > > + req.ndm.ndm_family = AF_INET6; > > + } -- David Gibson (he or they) | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you, not the other way | around. http://www.ozlabs.org/~dgibson