Index: head/sys/net/if.c =================================================================== --- head/sys/net/if.c +++ head/sys/net/if.c @@ -97,6 +97,13 @@ #include +/* + * Consumers of struct ifreq such as tcpdump assume no pad between ifr_name + * and ifr_ifru when it is used in SIOCGIFCONF. + */ +_Static_assert(sizeof(((struct ifreq *)0)->ifr_name) == + offsetof(struct ifreq, ifr_ifru), "gap between ifr_name and ifr_ifru"); + #ifdef COMPAT_FREEBSD32 #include #include Index: head/sys/netinet6/in6.c =================================================================== --- head/sys/netinet6/in6.c +++ head/sys/netinet6/in6.c @@ -112,6 +112,14 @@ #include #include +/* + * struct in6_ifreq and struct ifreq must be type punnable for common members + * of ifr_ifru to allow accessors to be shared. + */ +_Static_assert(offsetof(struct in6_ifreq, ifr_ifru) == + offsetof(struct ifreq, ifr_ifru), + "struct in6_ifreq and struct ifreq are not type punnable"); + VNET_DECLARE(int, icmp6_nodeinfo_oldmcprefix); #define V_icmp6_nodeinfo_oldmcprefix VNET(icmp6_nodeinfo_oldmcprefix)