lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] PCB Stuck in CLOSING state. Ack is not accepted?


From: Leon Woestenberg
Subject: Re: [lwip-users] PCB Stuck in CLOSING state. Ack is not accepted?
Date: Mon, 12 Dec 2005 19:23:54 +0100
User-agent: Mozilla Thunderbird 1.0.6 (Windows/20050716)

Hello Jan,

Jan Ulvesten wrote:

I have earlier reported that some TCP connections gets stucked in the state CLOSING.

According to the RFC793, the CLOSING state is a state where both ends have sent a FIN, but the ACK on the FIN has not yet been received. There is not timeout in the CLOSING state. I guess that the CLOSING state isn’t used to often.

I have now analyzed this somewhat further.

tcp_in.c :

…

*case* FIN_WAIT_1:

tcp_receive(pcb);

*if* (flags & TCP_FIN) {

*if* (flags & TCP_ACK && ackno == pcb->snd_nxt) {

….

} *else* {

tcp_ack_now(pcb); ß control goes here every time in my test setup.

pcb->state = CLOSING;

}

…

In my test setup: Every time a FIN is received in FIN_WAIT_1 state, control goes to the part where the state is set to CLOSING

The received flags are TCP_FIN and TCP_ACK. ackno is equal to pcb->snd_nxt+1 ??

ackno is equal to pcb->snd_nxt+1 -> Is this really correct ? Should it be *if* (flags & TCP_ACK && ackno >= pcb->snd_nxt) ?

Well, thanks for the good analysis. Together with the RFCs and some BSD reference implementation, we should be able to solve this.

If this isn't solved in a week, please submit to the Savannah bug tracker... I do not have much time myself to investigate this.

Regards,

Leon.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]