Skip to content
Browse files

net: tcp: Add MSS option on sending SYN request

Currently, we add TCP options only to SYN+ACK reply to peer's SYN
(i.e. passive open). For consistency, add them also when we send
SYN ourselves (active open). In both cases, we add just MSS option

Signed-off-by: Paul Sokolovsky <>
  • Loading branch information...
pfalcon authored and nashif committed Jun 12, 2018
1 parent e62972b commit 268c0e33105f263255a56f8bd1dde8eaad3005cb
Showing with 7 additions and 1 deletion.
  1. +7 −1 subsys/net/ip/tcp.c
@@ -1830,8 +1830,14 @@ static inline int send_syn_segment(struct net_context *context,
struct net_pkt *pkt = NULL;
int ret;
u8_t options[NET_TCP_MAX_OPT_SIZE];
u8_t optionlen = 0;

if (flags == NET_TCP_SYN) {
net_tcp_set_syn_opt(context->tcp, options, &optionlen);

ret = net_tcp_prepare_segment(context->tcp, flags, NULL, 0,
ret = net_tcp_prepare_segment(context->tcp, flags, options, optionlen,
local, remote, &pkt);
if (ret) {
return ret;

0 comments on commit 268c0e3

Please sign in to comment.
You can’t perform that action at this time.