diff options
| author | Matt Macy <mmacy@FreeBSD.org> | 2018-06-08 17:37:49 +0000 |
|---|---|---|
| committer | Matt Macy <mmacy@FreeBSD.org> | 2018-06-08 17:37:49 +0000 |
| commit | 3db28e66567053f1b1f75da00cc644c1bef45088 (patch) | |
| tree | ec4fffbfb5f6856e96e0d71d160f8c64b913368b | |
| parent | afbd6cfa72a7ac63e0584c20198e0ba76c862398 (diff) | |
Notes
| -rw-r--r-- | sys/netinet/tcp_fsm.h | 23 | ||||
| -rw-r--r-- | sys/netinet/tcp_output.c | 20 |
2 files changed, 22 insertions, 21 deletions
diff --git a/sys/netinet/tcp_fsm.h b/sys/netinet/tcp_fsm.h index dcc4a4e8aa63..df14ae57a844 100644 --- a/sys/netinet/tcp_fsm.h +++ b/sys/netinet/tcp_fsm.h @@ -78,27 +78,8 @@ #define TCPS_HAVERCVDFIN(s) \ ((s) == TCPS_CLOSE_WAIT || ((s) >= TCPS_CLOSING && (s) != TCPS_FIN_WAIT_2)) -#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 + +extern u_char tcp_outflags[TCP_NSTATES]; #ifdef KPROF int tcp_acounts[TCP_NSTATES][PRU_NREQ]; diff --git a/sys/netinet/tcp_output.c b/sys/netinet/tcp_output.c index 2804a4eda26c..1378530af3f1 100644 --- a/sys/netinet/tcp_output.c +++ b/sys/netinet/tcp_output.c @@ -169,6 +169,26 @@ hhook_run_tcp_est_out(struct tcpcb *tp, struct tcphdr *th, #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 */ static void inline |
