net: tcp: Cancel the fin_timer on FIN message in FIN_WAIT1 state

fin_timer will be started after sending FIN to peer. After successful
reception of FIN+ACK message in FIN_WAIT1 state, fin_timer should be
cancelled.

Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
This commit is contained in:
Ravi kumar Veeramally 2017-12-19 15:57:06 +02:00 committed by Anas Nashif
parent dfe5cb731c
commit 124c067027

View File

@ -1175,6 +1175,8 @@ NET_CONN_CB(tcp_established)
if (net_tcp_get_state(context->tcp)
== NET_TCP_FIN_WAIT_1) {
/* Received FIN on FIN_WAIT1, so cancel the timer */
k_delayed_work_cancel(&context->tcp->fin_timer);
/* Active close: step to FIN_WAIT_2 */
net_tcp_change_state(context->tcp, NET_TCP_FIN_WAIT_2);
} else if (net_tcp_get_state(context->tcp)