net: tcp2: On active connection close go to FIN_WAIT_1
In order to implement active connection close with the TIME_WAIT state, send FIN and enter FIN_WAIT_1 state. We actually send FIN+ACK as most of the implementations do. Signed-off-by: Oleg Zhurakivskyy <oleg.zhurakivskyy@intel.com>
This commit is contained in:
parent
40799bc986
commit
4fbf3c3672
1 changed files with 4 additions and 3 deletions
|
@ -957,7 +957,7 @@ next_state:
|
|||
k_mutex_unlock(&conn->lock);
|
||||
}
|
||||
|
||||
/* close() has been called on the socket */
|
||||
/* Active connection close: send FIN and go to FIN_WAIT_1 state */
|
||||
int net_tcp_put(struct net_context *context)
|
||||
{
|
||||
struct tcp *conn = context->tcp;
|
||||
|
@ -965,8 +965,9 @@ int net_tcp_put(struct net_context *context)
|
|||
NET_DBG("%s", conn ? log_strdup(tcp_conn_state(conn, NULL)) : "");
|
||||
|
||||
if (conn) {
|
||||
conn->state = TCP_CLOSE_WAIT;
|
||||
tcp_in(conn, NULL);
|
||||
tcp_out(conn, FIN | ACK);
|
||||
|
||||
conn_state(conn, TCP_FIN_WAIT_1);
|
||||
}
|
||||
|
||||
net_context_unref(context);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue