[bug #54076] tcp: timeout required in FIN_WAIT_2 if pcb has been closed

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[bug #54076] tcp: timeout required in FIN_WAIT_2 if pcb has been closed

Simon Goldschmidt
URL:
  <http://savannah.nongnu.org/bugs/?54076>

                 Summary: tcp: timeout required in FIN_WAIT_2 if pcb has been
closed
                 Project: lwIP - A Lightweight TCP/IP stack
            Submitted by: goldsimon
            Submitted on: Wed 06 Jun 2018 08:10:06 PM UTC
                Category: None
                Severity: 3 - Normal
              Item Group: None
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any
         Planned Release: None
            lwIP version: git head

    _______________________________________________________

Details:

Since tcp_alloc() does not kill same-priority pcbs any more (only lower
priorities), we need a timeout in FIN_WAIT_2.

However, this timeout must not trigger if the connection has deliberately
half-closed (i.e. shutdown was called, not close).




    _______________________________________________________

Reply to this item at:

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

_______________________________________________
  Message sent via Savannah
  https://savannah.nongnu.org/


_______________________________________________
lwip-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-devel
Reply | Threaded
Open this post in threaded view
|

[bug #54076] tcp: timeout required in FIN_WAIT_2 if pcb has been closed

Simon Goldschmidt
Follow-up Comment #1, bug #54076 (project lwip):

The mailing list discussion with more information starts here:

https://lists.nongnu.org/archive/html/lwip-users/2018-06/msg00015.html

I just wanted to clarify the comment above about half-closed connections: Say
a raw lwIP client connects with tcp_connect() and then shutdowns the Tx side
of the connection, because the client expects data to automatically flow upon
connection only from the server to the client. lwIP should consider this
half-closed connection to be a normal connection that is still working fine.


    _______________________________________________________

Reply to this item at:

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

_______________________________________________
  Message sent via Savannah
  https://savannah.nongnu.org/


_______________________________________________
lwip-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-devel
Reply | Threaded
Open this post in threaded view
|

[bug #54076] tcp: timeout required in FIN_WAIT_2 if pcb has been closed

Simon Goldschmidt
Follow-up Comment #2, bug #54076 (project lwip):

> lwIP should consider this half-closed connection to be a normal connection
that is still working fine.

It does. That's why we don't have this timeout, yet.

    _______________________________________________________

Reply to this item at:

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

_______________________________________________
  Message sent via Savannah
  https://savannah.nongnu.org/


_______________________________________________
lwip-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-devel
Reply | Threaded
Open this post in threaded view
|

[bug #54076] tcp: timeout required in FIN_WAIT_2 if pcb has been closed

Simon Goldschmidt
Follow-up Comment #3, bug #54076 (project lwip):

I think this already exists in tcp_slowtmr.

    /* Check if this PCB has stayed too long in FIN-WAIT-2 */
    if (pcb->state == FIN_WAIT_2) {
      /* If this PCB is in FIN_WAIT_2 because of SHUT_WR don't let it time
out. */
      if (pcb->flags & TF_RXCLOSED) {
        /* PCB was fully closed (either through close() or SHUT_RDWR):
           normal FIN-WAIT timeout handling. */
        if ((u32_t)(tcp_ticks - pcb->tmr) >
            TCP_FIN_WAIT_TIMEOUT / TCP_SLOW_INTERVAL) {
          ++pcb_remove;
          LWIP_DEBUGF(TCP_DEBUG, ("tcp_slowtmr: removing pcb stuck in
FIN-WAIT-2\n"));
        }
      }
    }


    _______________________________________________________

Reply to this item at:

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

_______________________________________________
  Message sent via Savannah
  https://savannah.nongnu.org/


_______________________________________________
lwip-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-devel