The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=6857b3a04e59d178f7716ba409d08a57f850ffcf
commit 6857b3a04e59d178f7716ba409d08a57f850ffcf Author: Gleb Smirnoff <[email protected]> AuthorDate: 2026-01-23 22:16:42 +0000 Commit: Gleb Smirnoff <[email protected]> CommitDate: 2026-01-23 22:16:42 +0000 netinet6: embed struct nd_ifinfo into struct in6_ndireq There is no functional change here, but we'd like to emphasize that the nd_ifinfo structure is not a actually a kernel ND6 software context, despite being actively used like this way, but an API/ABI structure for ioctl(2). This should prevent from a ABI breakages like in 31ec8b6407fd. This also is a step towards stopping using it as a kernel software context. Reviewed by: tuexen Differential Revision: https://reviews.freebsd.org/D54722 --- sys/netinet6/nd6.h | 40 ++++++++++++++++++++++------------------ 1 file changed, 22 insertions(+), 18 deletions(-) diff --git a/sys/netinet6/nd6.h b/sys/netinet6/nd6.h index 0f61e167f480..28de6e2ae153 100644 --- a/sys/netinet6/nd6.h +++ b/sys/netinet6/nd6.h @@ -62,22 +62,6 @@ struct llentry; #define ND6_IS_LLINFO_PROBREACH(n) ((n)->ln_state > ND6_LLINFO_INCOMPLETE) #define ND6_LLINFO_PERMANENT(n) (((n)->la_expire == 0) && ((n)->ln_state > ND6_LLINFO_INCOMPLETE)) -struct nd_ifinfo { - u_int32_t linkmtu; /* LinkMTU */ - u_int32_t maxmtu; /* Upper bound of LinkMTU */ - u_int32_t basereachable; /* BaseReachableTime */ - u_int32_t reachable; /* Reachable Time */ - u_int32_t retrans; /* Retrans Timer */ - u_int32_t flags; /* Flags */ - int recalctm; /* BaseReacable re-calculation timer */ - u_int8_t chlim; /* CurHopLimit */ - u_int8_t initialized; /* Flag to see the entry is initialized */ - /* the following 3 members are for privacy extension for addrconf */ - u_int8_t randomseed0[8]; /* upper 64 bits of MD5 digest */ - u_int8_t randomseed1[8]; /* lower 64 bits (usually the EUI64 IFID) */ - u_int8_t randomid[8]; /* current random ID */ -}; - #define ND6_IFF_PERFORMNUD 0x1 #define ND6_IFF_ACCEPT_RTADV 0x2 #define ND6_IFF_PREFER_SOURCE 0x4 /* Not used in FreeBSD. */ @@ -139,9 +123,29 @@ struct in6_prefix { /* struct sockaddr_in6 advrtr[] */ }; -struct in6_ndireq { +struct in6_ndireq { char ifname[IFNAMSIZ]; - struct nd_ifinfo ndi; + struct nd_ifinfo { + uint32_t linkmtu; /* LinkMTU */ + uint32_t maxmtu; /* Upper bound of LinkMTU */ + uint32_t basereachable; /* BaseReachableTime */ + uint32_t reachable; /* Reachable Time */ + uint32_t retrans; /* Retrans Timer */ + uint32_t flags; /* Flags */ + int recalctm; /* BaseReacable re-calculation timer */ + uint8_t chlim; /* CurHopLimit */ + /* + * The below members are not used. They came from KAME and + * are hanging around to preserve ABI compatibility of the + * SIOCGIFINFO_IN6 ioctl. + * The original comment documented the random* members as a + * privacy extension for addrconf. + */ + uint8_t initialized; /* compat: always 1 */ + uint8_t randomseed0[8]; /* upper 64 bits of MD5 digest */ + uint8_t randomseed1[8]; /* lower 64 bits (the EUI64 IFID?) */ + uint8_t randomid[8]; /* current random ID */ + } ndi; }; struct in6_ndifreq {
