net: tcp2: Fix handling of the END TCP option
End option indicates the end of the option list. Hence, correct way to handle it is to break out of the option parsing routine. Signed-off-by: Ruslan Mstoi <ruslan.mstoi@intel.com>
This commit is contained in:
parent
0c4b87dc9f
commit
e5f714575e
1 changed files with 3 additions and 1 deletions
|
@ -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);
|
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;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue