lwip-devel
[Top][All Lists]
Advanced

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

[lwip-devel] [bug #34636] FIN_WAIT_2 - Incorrect shutdown of TCP pcb


From: Amir Shalem
Subject: [lwip-devel] [bug #34636] FIN_WAIT_2 - Incorrect shutdown of TCP pcb
Date: Mon, 24 Oct 2011 20:45:54 +0000
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/14.0.835.202 Safari/535.1

URL:
  <http://savannah.nongnu.org/bugs/?34636>

                 Summary: FIN_WAIT_2 - Incorrect shutdown of TCP pcb
                 Project: lwIP - A Lightweight TCP/IP stack
            Submitted by: amirshalem
            Submitted on: Mon 24 Oct 2011 08:45:53 PM GMT
                Category: TCP
                Severity: 3 - Normal
              Item Group: Faulty Behaviour
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any
         Planned Release: 
            lwIP version: CVS Head

    _______________________________________________________

Details:

I propose to remove FIN_WAIT_2 state in TCP, because its a faulty feature.

Once you send shutdown(SHUT_WR) on a socket you should still be able to recv()
from it, select() on it, etc
until the otherside will send a shutdown (FIN), or close (RST).

Currently after our netconn/sockets api does shutdown(SHUT_WR), the tcp pcb
moves to FIN_WAIT_1,
which in there it waits for a completeing FIN/ACK,
and if the otherside only ACKs our FIN (because of shutdown), it will enter
state FIN_WAIT_2
which there the TCP pcb will be closed brutely after TCP_FIN_WAIT_TIMEOUT
(20ms)

This is not how it happens on Linux, nor Windows TCP sockets.
A cleanup patch afterwards will be to rename FIN_WAIT_1 to FIN_WAIT

Patch included.

thanks,
amir.



    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Mon 24 Oct 2011 08:45:53 PM GMT  Name:
incorrect-shutdown-remove-FIN_WAIT_2.patch  Size: 3kB   By: amirshalem
bugfix patch
<http://savannah.nongnu.org/bugs/download.php?file_id=24192>

    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/bugs/?34636>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.nongnu.org/




reply via email to

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