Don't send a second FIN if we receive a FIN while in FIN_WAIT_2
This commit is contained in:
parent
61ed298bc7
commit
be31970e36
@ -573,13 +573,14 @@ static int tcp_rx_fin ( struct tcp_connection *conn, uint32_t seq ) {
|
|||||||
if ( ( conn->rcv_ack - seq ) > 0 )
|
if ( ( conn->rcv_ack - seq ) > 0 )
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
/* Mark FIN as received and send our own FIN */
|
/* Mark FIN as received and acknowledge it */
|
||||||
conn->tcp_state |= ( TCP_STATE_RCVD ( TCP_FIN ) |
|
conn->tcp_state |= TCP_STATE_RCVD ( TCP_FIN );
|
||||||
TCP_STATE_SENDING ( TCP_FIN ) );
|
|
||||||
|
|
||||||
/* Acknowledge FIN */
|
|
||||||
conn->rcv_ack++;
|
conn->rcv_ack++;
|
||||||
|
|
||||||
|
/* If we haven't already sent our FIN, send a FIN */
|
||||||
|
if ( ! ( conn->tcp_state & TCP_STATE_ACKED ( TCP_FIN ) ) )
|
||||||
|
conn->tcp_state |= TCP_STATE_SENDING ( TCP_FIN );
|
||||||
|
|
||||||
/* Break association with application */
|
/* Break association with application */
|
||||||
tcp_disassociate ( conn );
|
tcp_disassociate ( conn );
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user