summaryrefslogtreecommitdiffstats
path: root/src/vnet/tcp/tcp.h
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2017-05-04 14:25:50 -0700
committerDave Barach <openvpp@barachs.net>2017-05-07 12:38:39 +0000
commitc8343412ee0deaa8e9192cbc4846aae1e9f48a4d (patch)
treeabcf3611fe398e7744dc9c9bdb080a1453caa9e4 /src/vnet/tcp/tcp.h
parent3af90fceb61d0c236709c25df936bbbf304cbff5 (diff)
Include TCP options in segment size computation
Ensure that TCP data plus options does not exceed peer's advertised MSS. Change-Id: I0de824cb3619346f0394dd694942fc1cf33a82b7 Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vnet/tcp/tcp.h')
-rw-r--r--src/vnet/tcp/tcp.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/vnet/tcp/tcp.h b/src/vnet/tcp/tcp.h
index c75479dce5c..8212ada785e 100644
--- a/src/vnet/tcp/tcp.h
+++ b/src/vnet/tcp/tcp.h
@@ -211,7 +211,9 @@ typedef struct _tcp_connection
u32 irs; /**< initial remote sequence */
/* Options */
- tcp_options_t opt; /**< TCP connection options parsed */
+ tcp_options_t opt; /**< TCP connection options parsed */
+ tcp_options_t snd_opts; /**< Tx options for connection */
+ u8 snd_opts_len; /**< Tx options len */
u8 rcv_wscale; /**< Window scale to advertise to peer */
u8 snd_wscale; /**< Window scale to use when sending */
u32 tsval_recent; /**< Last timestamp received */
@@ -241,7 +243,8 @@ typedef struct _tcp_connection
u32 rtt_ts; /**< Timestamp for tracked ACK */
u32 rtt_seq; /**< Sequence number for tracked ACK */
- u16 snd_mss; /**< Send MSS */
+ u16 snd_mss; /**< Effective send max seg (data) size */
+ u16 mss; /**< Our max seg size that includes options */
} tcp_connection_t;
struct _tcp_cc_algorithm
@@ -405,7 +408,8 @@ void tcp_make_synack (tcp_connection_t * ts, vlib_buffer_t * b);
void tcp_send_reset (vlib_buffer_t * pkt, u8 is_ip4);
void tcp_send_syn (tcp_connection_t * tc);
void tcp_send_fin (tcp_connection_t * tc);
-void tcp_set_snd_mss (tcp_connection_t * tc);
+void tcp_init_mss (tcp_connection_t * tc);
+void tcp_update_snd_mss (tcp_connection_t * tc);
always_inline u32
tcp_end_seq (tcp_header_t * th, u32 len)