[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lwip-devel] [bug #46701] Non-standard close behavior can result in sock
From: |
Joel Cunningham |
Subject: |
[lwip-devel] [bug #46701] Non-standard close behavior can result in socket/netconn leaks |
Date: |
Thu, 17 Dec 2015 19:54:23 +0000 |
User-agent: |
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:42.0) Gecko/20100101 Firefox/42.0 |
Follow-up Comment #2, bug #46701 (project lwip):
I found another case where this is happening. If once in a blocking close,
trying to send a FIN, if an RST is received, the TCP error callback is called,
returning ERR_RST (ECONNRESET) to the application thread that is blocked.
When this happens, the netconn and socket are leaked
The area in netconn_delete() only calls netconn_free() if err equals ERR_OK.
The same happens in lwip_close(), free_socket() is only called if err ==
ERR_OK
This is a slightly different problem than the EWOULDBLOCK as the PCB has
indeed been deleted, but then we fail deleting the socket/netconn
I'm not sure if we try to detect if the PCB is gone during error handling in
netconn_delete and only delete if so?
Ideally, as outlined below, we would want to delete the netconn/socket in all
cases
_______________________________________________________
Reply to this item at:
<http://savannah.nongnu.org/bugs/?46701>
_______________________________________________
Message sent via/by Savannah
http://savannah.nongnu.org/