git: 59e095633d5b - stable/13 - tcp: Avoid conditionally defined fields in union lro_address

From: Mark Johnston <markj_at_FreeBSD.org>
Date: Mon, 21 Feb 2022 14:58:06 UTC
The branch stable/13 has been updated by markj:

URL: https://cgit.FreeBSD.org/src/commit/?id=59e095633d5b953a96118af4b7dee1263e8d10ba

commit 59e095633d5b953a96118af4b7dee1263e8d10ba
Author:     Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2022-02-10 20:31:26 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2022-02-21 14:57:04 +0000

    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
    Sponsored by:   The FreeBSD Foundation
    
    (cherry picked from commit b4f60fab5d3fdd2ea51c1151fa79b2c541c6b81a)
---
 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 b8abc2fa1ab3..82cf1af218d6 100644
--- a/sys/netinet/tcp_lro.h
+++ b/sys/netinet/tcp_lro.h
@@ -34,6 +34,7 @@
 #define _TCP_LRO_H_
 
 #include <sys/time.h>
+#include <netinet/in.h>
 
 #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));