[En-Nut-Discussion] Connection reset when trying to connect

Harald Kipp harald.kipp at egnite.de
Sun Oct 12 18:52:02 CEST 2003


Hi Oliver,

Took some time diving into the code again.

>The next received packet is handled by NutTcpStateSynSent. If TH_SYN is set
>without TH_ACK, the stack changes the state to TCPS_SYN_RECEIVED and sends a
>SYN & ACK packet to the peer. This is ok, because simultaneous initiation of
>the connection can occur according to the rfc.
>
>But then, the next packet is handled by NutTcpStateSynReceived, if an RST is
>received the state changes to TCPS_LISTEN, which converts the socket to a
>listen-socket as you would have called NutTcpAccept ?!?

Definitely Nut/Net fails on simultanous initiation. With
utmost probability this situation will never occur.
(See: TCP/IP Illustrated Volume 1 - Chapter 18.8.)
But, in case it does, NutTcpConnect will indeed never return.
In is unacceptable.

Googling through the web doesn't help much. I'd suggest
to send a RST response, if TH_SYN without TH_ACK is
received during TCPS_SYN_SENT state. Any other comments?

Regards,
Harald

P.S. Mike's RST problem is different, but I'll check
this now.




More information about the En-Nut-Discussion mailing list