lwip-devel
[Top][All Lists]
Advanced

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

[lwip-devel] [patch #10013] tcp_in: Flag the pcb as closing if TCP_EVENT


From: David Cermak
Subject: [lwip-devel] [patch #10013] tcp_in: Flag the pcb as closing if TCP_EVENT_CLOSED refused
Date: Thu, 7 Jan 2021 13:45:47 -0500 (EST)
User-agent: Mozilla/5.0 (X11; Fedora; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36

URL:
  <https://savannah.nongnu.org/patch/?10013>

                 Summary: tcp_in: Flag the pcb as closing if TCP_EVENT_CLOSED
refused
                 Project: lwIP - A Lightweight TCP/IP stack
            Submitted by: david_cermak
            Submitted on: Thu 07 Jan 2021 06:45:45 PM UTC
                Category: TCP
                Priority: 5 - Normal
                  Status: None
                 Privacy: Public
             Assigned to: None
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
         Planned Release: None

    _______________________________________________________

Details:

This fixes issue which has been reported 
* to esp-lwip fork as https://github.com/espressif/esp-lwip/issues/18
* and here as bug#58797 (https://savannah.nongnu.org/bugs/?58797)

If the packet contained FIN flag, we post a TCP_EVENT_CLOSE with null pbuf,
which could get lost if the underlying platform implementation of
sys_mbox_(try)post() returns ERR_MEM (i.e. won't fit into the recv mailbox).
Loosing this event causes trouble since the FIN initiator gets ACK'ed and
assumes the connection has closed, but the TCP state machine is stuck in its
active state.

Fixed by flagging the pcb as closing if the ERR_MEM returned.

This could be perhaps fixed by adding LWIP_EVENT_API and implement the events
in the port layers, but think this way it is cleaner. Open to suggestions.



    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Thu 07 Jan 2021 06:45:45 PM UTC  Name:
tcp_in-Flag-the-pcb-as-closing-if-TCP_EVENT_CLOSED-refused.patch  Size: 2KiB  
By: david_cermak

<http://savannah.nongnu.org/patch/download.php?file_id=50674>

    _______________________________________________________

Reply to this item at:

  <https://savannah.nongnu.org/patch/?10013>

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




reply via email to

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