From: Florin Coras Date: Fri, 5 Mar 2021 21:30:18 +0000 (-0800) Subject: tcp: account for option alignment in initial snd_mss X-Git-Tag: v21.10-rc0~400 X-Git-Url: https://gerrit.fd.io/r/gitweb?p=vpp.git;a=commitdiff_plain;h=7a588fc7819153fe32e7d12733da4ecd2e663437 tcp: account for option alignment in initial snd_mss Type: fix Signed-off-by: Florin Coras Change-Id: I24225ada6623c5b5543341ecac0d6c1db43cc8a9 --- 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 */; } /**