[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lwip-devel] [bug #46696] accepts_pending not decreased when TCP_EVENT_A
From: |
Joel Cunningham |
Subject: |
[lwip-devel] [bug #46696] accepts_pending not decreased when TCP_EVENT_ACCEPT returns error |
Date: |
Wed, 16 Dec 2015 21:39:19 +0000 |
User-agent: |
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:42.0) Gecko/20100101 Firefox/42.0 |
Follow-up Comment #2, bug #46696 (project lwip):
Thinking about this more, the tcp_accept_null() function also has the same
problem (actually any accept callback that calls tcp_abort and returns
ERR_ABRT). It calls tcp_abort(), but since the connection is in ESTABLISHED
state, accepts_pending won't be decremented
The problem seems to stem from the fact that the connections are in the
ESTABLISHED state and still in the backlog, but this knowledge isn't tracked
at the TCP level and instead relies on upper layers (netconn's accept mbox) to
associate the established connections with the listener. The upper layer is
then responsible for calling tcp_accepted() when the pending connections are
pulled off the backlog.
For this same reason we can't just adjust the tcp_pcb_purge() to check for
ESTABLISHED PCBs in the backlog because TCP doesn't know which ESTABLISHED
PCBs are in the backlog and which aren't. The SYN_RCVD check in
tcp_pcb_purge() learns which connections are still in the backlog by matching
the local port with a listener and using the SYN_RCVD state.
Maybe we need an actual backlog queue of PCBs in LwIP? I know other stacks
have multiple queues depending on the state of the pending connection
_______________________________________________________
Reply to this item at:
<http://savannah.nongnu.org/bugs/?46696>
_______________________________________________
Message sent via/by Savannah
http://savannah.nongnu.org/