git: b4f60fab5d3f - main - tcp: Avoid conditionally defined fields in union lro_address
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 10 Feb 2022 20:42:02 UTC
The branch main has been updated by markj:
URL: https://cgit.FreeBSD.org/src/commit/?id=b4f60fab5d3fdd2ea51c1151fa79b2c541c6b81a
commit b4f60fab5d3fdd2ea51c1151fa79b2c541c6b81a
Author: Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2022-02-10 20:31:26 +0000
Commit: Mark Johnston <markj@FreeBSD.org>
CommitDate: 2022-02-10 20:39:58 +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
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 <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));