summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorguenther <guenther@openbsd.org>2010-10-23 22:50:07 +0000
committerguenther <guenther@openbsd.org>2010-10-23 22:50:07 +0000
commit024bd919263954b8027523f3cc80d880c37dbddc (patch)
tree16746babcafeb347080003de6ef84ed6eb14ebaa
parentescape '[' in filename tab-completion; fix a type while there. (diff)
downloadwireguard-openbsd-024bd919263954b8027523f3cc80d880c37dbddc.tar.xz
wireguard-openbsd-024bd919263954b8027523f3cc80d880c37dbddc.zip
Fix pr 6192: make netinet/tcp.h follow SUSv4 namespace rules by
hiding everything but the TCP_* options unless __BSD_VISIBLE. While we're here, change the structure to use u_int32_t instead of u_int to cut-off the types discussion. ok tedu@, mikeb@
-rw-r--r--sys/netinet/tcp.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/sys/netinet/tcp.h b/sys/netinet/tcp.h
index c6b22e70c3b..2dffa983efd 100644
--- a/sys/netinet/tcp.h
+++ b/sys/netinet/tcp.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: tcp.h,v 1.17 2006/04/27 02:19:32 tedu Exp $ */
+/* $OpenBSD: tcp.h,v 1.18 2010/10/23 22:50:07 guenther Exp $ */
/* $NetBSD: tcp.h,v 1.8 1995/04/17 05:32:58 cgd Exp $ */
/*
@@ -35,6 +35,10 @@
#ifndef _NETINET_TCP_H_
#define _NETINET_TCP_H_
+#include <sys/cdefs.h>
+
+#if __BSD_VISIBLE
+
typedef u_int32_t tcp_seq;
/*
@@ -47,11 +51,11 @@ struct tcphdr {
tcp_seq th_seq; /* sequence number */
tcp_seq th_ack; /* acknowledgement number */
#if _BYTE_ORDER == _LITTLE_ENDIAN
- u_int th_x2:4, /* (unused) */
+ u_int32_t th_x2:4, /* (unused) */
th_off:4; /* data offset */
#endif
#if _BYTE_ORDER == _BIG_ENDIAN
- u_int th_off:4, /* data offset */
+ u_int32_t th_off:4, /* data offset */
th_x2:4; /* (unused) */
#endif
u_int8_t th_flags;
@@ -114,6 +118,8 @@ struct tcphdr {
#define TCP_MAX_WINSHIFT 14 /* maximum window shift */
+#endif /* __BSD_VISIBLE */
+
/*
* User-settable options (used with setsockopt).
*/