diff --git a/subsys/net/ip/tcp2.c b/subsys/net/ip/tcp2.c index fc1eadef21c..7396d295258 100644 --- a/subsys/net/ip/tcp2.c +++ b/subsys/net/ip/tcp2.c @@ -387,7 +387,9 @@ static bool tcp_options_check(void *buf, ssize_t len) NET_DBG("opt: %hu, opt_len: %hu", (u16_t)opt, (u16_t)opt_len); - if (opt == TCPOPT_END || opt == TCPOPT_NOP) { + if (opt == TCPOPT_END) { + break; + } else if (opt == TCPOPT_NOP) { continue; }