From b4f60fab5d3fdd2ea51c1151fa79b2c541c6b81a Mon Sep 17 00:00:00 2001 From: Mark Johnston Date: Thu, 10 Feb 2022 15:31:26 -0500 Subject: [PATCH] tcp: Avoid conditionally defined fields in union lro_address The layout of the structure ends up depending on whether the including file includes opt_inet.h and opt_inet6.h, so different compilation units can end up seeing different versions of the structure. Fix this by unconditionally defining the address fields. As a side effect, this eliminates some duplication in the kernel's CTF type graph. Reviewed by: rscheff, tuexen MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D34242 --- sys/netinet/tcp_lro.h | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/sys/netinet/tcp_lro.h b/sys/netinet/tcp_lro.h index dd2aa1148822..427657df47e7 100644 --- a/sys/netinet/tcp_lro.h +++ b/sys/netinet/tcp_lro.h @@ -34,6 +34,7 @@ #define _TCP_LRO_H_ #include +#include #ifndef TCP_LRO_ENTRIES /* Define default number of LRO entries per RX queue */ @@ -80,20 +81,12 @@ union lro_address { uint16_t d_port; /* destination TCP/UDP port */ uint32_t vxlan_vni; /* VXLAN virtual network identifier */ union { -#ifdef INET struct in_addr v4; -#endif -#ifdef INET6 struct in6_addr v6; -#endif } s_addr; /* source IPv4/IPv6 address */ union { -#ifdef INET struct in_addr v4; -#endif -#ifdef INET6 struct in6_addr v6; -#endif } d_addr; /* destination IPv4/IPv6 address */ }; } __aligned(sizeof(u_long));