Changeset View
Changeset View
Standalone View
Standalone View
sys/netinet/tcp_usrreq.c
Context not available. | |||||
tcp_state_change(tp, TCPS_LAST_ACK); | tcp_state_change(tp, TCPS_LAST_ACK); | ||||
break; | break; | ||||
} | } | ||||
if ((tp->t_state == TCPS_LAST_ACK) && | |||||
(tp->t_flags & TF_SENTFIN)) { | |||||
/* | |||||
* If we have reached LAST_ACK, and | |||||
* we sent a FIN (e.g. via MSG_EOR), then | |||||
* we really should move to either FIN_WAIT_1 | |||||
* or FIN_WAIT_2 depending on snd_max/snd_una. | |||||
*/ | |||||
if (tp->snd_una == tp->snd_max) { | |||||
/* The FIN is acked */ | |||||
tcp_state_change(tp, TCPS_FIN_WAIT_2); | |||||
} else { | |||||
/* The FIN is still outstanding */ | |||||
tcp_state_change(tp, TCPS_FIN_WAIT_1); | |||||
} | |||||
} | |||||
if (tp->t_state >= TCPS_FIN_WAIT_2) { | if (tp->t_state >= TCPS_FIN_WAIT_2) { | ||||
soisdisconnected(tp->t_inpcb->inp_socket); | soisdisconnected(tp->t_inpcb->inp_socket); | ||||
/* Prevent the connection hanging in FIN_WAIT_2 forever. */ | /* Prevent the connection hanging in FIN_WAIT_2 forever. */ | ||||
Context not available. |