net: context: Close connection fast if TIME_WAIT support is off
If the CONFIG_NET_TCP_TIME_WAIT support is disabled, then do not start to wait for reply to sent FIN in active close, but unref the corresponding net_context in order to close the connection as soon as possible. Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This commit is contained in:
parent
0bdd4db98f
commit
210c30805b
1 changed files with 6 additions and 4 deletions
|
@ -433,10 +433,12 @@ int net_context_put(struct net_context *context)
|
|||
if ((net_context_get_state(context) == NET_CONTEXT_CONNECTED ||
|
||||
net_context_get_state(context) == NET_CONTEXT_LISTENING)
|
||||
&& !context->tcp->fin_rcvd) {
|
||||
NET_DBG("TCP connection in active close, not "
|
||||
"disposing yet");
|
||||
queue_fin(context);
|
||||
return 0;
|
||||
if (IS_ENABLED(CONFIG_NET_TCP_TIME_WAIT)) {
|
||||
NET_DBG("TCP connection in active close, not "
|
||||
"disposing yet");
|
||||
queue_fin(context);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif /* CONFIG_NET_TCP */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue