diff options
author | Florin Coras <fcoras@cisco.com> | 2021-03-05 13:30:18 -0800 |
---|---|---|
committer | Dave Barach <openvpp@barachs.net> | 2021-03-08 15:26:28 +0000 |
commit | 7a588fc7819153fe32e7d12733da4ecd2e663437 (patch) | |
tree | c9ab7718b76ae054307ca0bc26986948cc61cd05 /src/vnet | |
parent | e3416e307e263dc565546c4e748df99b584708a0 (diff) |
tcp: account for option alignment in initial snd_mss
Type: fix
Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I24225ada6623c5b5543341ecac0d6c1db43cc8a9
Diffstat (limited to 'src/vnet')
-rw-r--r-- | src/vnet/tcp/tcp.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/vnet/tcp/tcp.c b/src/vnet/tcp/tcp.c index 407ba9576a8..161b8ef25a2 100644 --- a/src/vnet/tcp/tcp.c +++ b/src/vnet/tcp/tcp.c @@ -657,9 +657,10 @@ tcp_init_mss (tcp_connection_t * tc) /* We should have enough space for 40 bytes of options */ ASSERT (tc->snd_mss > 45); - /* If we use timestamp option, account for it */ + /* If we use timestamp option, account for it and make sure + * the options are 4-byte aligned */ if (tcp_opts_tstamp (&tc->rcv_opts)) - tc->snd_mss -= TCP_OPTION_LEN_TIMESTAMP; + tc->snd_mss -= TCP_OPTION_LEN_TIMESTAMP + 2 /* alignment */; } /** |