net: tcp2: Extract the MSS from the TCP option value
Extract the maximum segment size (MSS) from the TCP option value. Signed-off-by: Oleg Zhurakivskyy <oleg.zhurakivskyy@intel.com>
This commit is contained in:
parent
9efdbe19dd
commit
58b7847afb
2 changed files with 6 additions and 1 deletions
|
@ -433,8 +433,9 @@ static bool tcp_options_check(struct tcp_options *recv_options,
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
recv_options->mss = opt;
|
recv_options->mss = ntohs(*((u16_t *)(options + 2)));
|
||||||
recv_options->mss_found = true;
|
recv_options->mss_found = true;
|
||||||
|
NET_DBG("MSS=%hu", recv_options->mss);
|
||||||
break;
|
break;
|
||||||
case TCPOPT_WINDOW:
|
case TCPOPT_WINDOW:
|
||||||
if (opt_len != 3) {
|
if (opt_len != 3) {
|
||||||
|
|
|
@ -77,6 +77,10 @@
|
||||||
#define conn_ack(_conn, _req) (_conn)->ack += (_req)
|
#define conn_ack(_conn, _req) (_conn)->ack += (_req)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define conn_mss(_conn) \
|
||||||
|
((_conn)->recv_options.mss_found ? \
|
||||||
|
(_conn)->recv_options.mss : NET_IPV6_MTU)
|
||||||
|
|
||||||
#define conn_state(_conn, _s) \
|
#define conn_state(_conn, _s) \
|
||||||
({ \
|
({ \
|
||||||
NET_DBG("%s->%s", \
|
NET_DBG("%s->%s", \
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue