Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 23 Jun 2018 06:53:53 +0000 (UTC)
From:      Gleb Smirnoff <glebius@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r335577 - in head/sys/netinet: . tcp_stacks
Message-ID:  <201806230653.w5N6rrP7000929@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: glebius
Date: Sat Jun 23 06:53:53 2018
New Revision: 335577
URL: https://svnweb.freebsd.org/changeset/base/335577

Log:
  Revert r334843, and partially revert r335180.
  
  tcp_outflags[] were defined since 4BSD and are defined nowadays in
  all its descendants. Removing them breaks third party application.

Modified:
  head/sys/netinet/tcp_fsm.h
  head/sys/netinet/tcp_offload.c
  head/sys/netinet/tcp_output.c
  head/sys/netinet/tcp_stacks/rack.c

Modified: head/sys/netinet/tcp_fsm.h
==============================================================================
--- head/sys/netinet/tcp_fsm.h	Sat Jun 23 03:17:11 2018	(r335576)
+++ head/sys/netinet/tcp_fsm.h	Sat Jun 23 06:53:53 2018	(r335577)
@@ -78,8 +78,27 @@
 #define	TCPS_HAVERCVDFIN(s)	\
     ((s) == TCPS_CLOSE_WAIT || ((s) >= TCPS_CLOSING && (s) != TCPS_FIN_WAIT_2))
 
-
-extern u_char	tcp_outflags[TCP_NSTATES];
+#ifdef	TCPOUTFLAGS
+/*
+ * Flags used when sending segments in tcp_output.  Basic flags (TH_RST,
+ * TH_ACK,TH_SYN,TH_FIN) are totally determined by state, with the proviso
+ * that TH_FIN is sent only if all data queued for output is included in the
+ * segment.
+ */
+static u_char	tcp_outflags[TCP_NSTATES] = {
+	TH_RST|TH_ACK,		/* 0, CLOSED */
+	0,			/* 1, LISTEN */
+	TH_SYN,			/* 2, SYN_SENT */
+	TH_SYN|TH_ACK,		/* 3, SYN_RECEIVED */
+	TH_ACK,			/* 4, ESTABLISHED */
+	TH_ACK,			/* 5, CLOSE_WAIT */
+	TH_FIN|TH_ACK,		/* 6, FIN_WAIT_1 */
+	TH_FIN|TH_ACK,		/* 7, CLOSING */
+	TH_FIN|TH_ACK,		/* 8, LAST_ACK */
+	TH_ACK,			/* 9, FIN_WAIT_2 */
+	TH_ACK,			/* 10, TIME_WAIT */
+};	
+#endif
 
 #ifdef KPROF
 int	tcp_acounts[TCP_NSTATES][PRU_NREQ];

Modified: head/sys/netinet/tcp_offload.c
==============================================================================
--- head/sys/netinet/tcp_offload.c	Sat Jun 23 03:17:11 2018	(r335576)
+++ head/sys/netinet/tcp_offload.c	Sat Jun 23 06:53:53 2018	(r335577)
@@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$");
 #include <netinet/in_pcb.h>
 #include <netinet/tcp.h>
 #include <netinet/tcp_offload.h>
+#define	TCPOUTFLAGS
 #include <netinet/tcp_fsm.h>
 #include <netinet/tcp_var.h>
 #include <netinet/toecore.h>

Modified: head/sys/netinet/tcp_output.c
==============================================================================
--- head/sys/netinet/tcp_output.c	Sat Jun 23 03:17:11 2018	(r335576)
+++ head/sys/netinet/tcp_output.c	Sat Jun 23 06:53:53 2018	(r335577)
@@ -72,6 +72,7 @@ __FBSDID("$FreeBSD$");
 #include <netinet6/ip6_var.h>
 #endif
 #include <netinet/tcp.h>
+#define	TCPOUTFLAGS
 #include <netinet/tcp_fsm.h>
 #include <netinet/tcp_log_buf.h>
 #include <netinet/tcp_seq.h>
@@ -166,26 +167,6 @@ hhook_run_tcp_est_out(struct tcpcb *tp, struct tcphdr 
 	}
 }
 #endif
-
-/*
- * Flags used when sending segments in tcp_output.  Basic flags (TH_RST,
- * TH_ACK,TH_SYN,TH_FIN) are totally determined by state, with the proviso
- * that TH_FIN is sent only if all data queued for output is included in the
- * segment.
- */
-u_char	tcp_outflags[TCP_NSTATES] = {
-	TH_RST|TH_ACK,		/* 0, CLOSED */
-	0,			/* 1, LISTEN */
-	TH_SYN,			/* 2, SYN_SENT */
-	TH_SYN|TH_ACK,		/* 3, SYN_RECEIVED */
-	TH_ACK,			/* 4, ESTABLISHED */
-	TH_ACK,			/* 5, CLOSE_WAIT */
-	TH_FIN|TH_ACK,		/* 6, FIN_WAIT_1 */
-	TH_FIN|TH_ACK,		/* 7, CLOSING */
-	TH_FIN|TH_ACK,		/* 8, LAST_ACK */
-	TH_ACK,			/* 9, FIN_WAIT_2 */
-	TH_ACK,			/* 10, TIME_WAIT */
-};
 
 /*
  * CC wrapper hook functions

Modified: head/sys/netinet/tcp_stacks/rack.c
==============================================================================
--- head/sys/netinet/tcp_stacks/rack.c	Sat Jun 23 03:17:11 2018	(r335576)
+++ head/sys/netinet/tcp_stacks/rack.c	Sat Jun 23 06:53:53 2018	(r335577)
@@ -76,6 +76,7 @@ __FBSDID("$FreeBSD$");
 #include <netinet6/in6_pcb.h>
 #include <netinet6/ip6_var.h>
 #include <netinet/tcp.h>
+#define	TCPOUTFLAGS
 #include <netinet/tcp_fsm.h>
 #include <netinet/tcp_log_buf.h>
 #include <netinet/tcp_seq.h>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201806230653.w5N6rrP7000929>