[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lwip-devel] [bug #46704] Fix blocking close with LWIP_SO_SNDTIMEO
From: |
Joel Cunningham |
Subject: |
[lwip-devel] [bug #46704] Fix blocking close with LWIP_SO_SNDTIMEO |
Date: |
Thu, 17 Dec 2015 16:05:56 +0000 |
User-agent: |
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:42.0) Gecko/20100101 Firefox/42.0 |
URL:
<http://savannah.nongnu.org/bugs/?46704>
Summary: Fix blocking close with LWIP_SO_SNDTIMEO
Project: lwIP - A Lightweight TCP/IP stack
Submitted by: jcunningham
Submitted on: Thu 17 Dec 2015 04:05:55 PM GMT
Category: sockets/netconn
Severity: 3 - Normal
Item Group: Faulty Behaviour
Status: None
Privacy: Public
Assigned to: None
Open/Closed: Open
Discussion Lock: Any
Planned Release:
lwIP version: git head
_______________________________________________________
Details:
A mis-typed comparison in lwip_netconn_do_close_internal() for the blocking
close case when a memory error is encountered would end up aborting rather
than blocking and retrying the close by setting the close_timeout to 0
The intention of the code was to initialize close_timeout to
LWIP_TCP_CLOSE_TIMEOUT_MS_DEFAULT, then over ride the value if a timeout was
specified via SO_SNDTIMEO, but the comparison was >= 0 instead of > 0. 0 is
the default send_timeout when the option is not used
#if LWIP_SO_SNDTIMEO || LWIP_SO_LINGER
s32_t close_timeout = LWIP_TCP_CLOSE_TIMEOUT_MS_DEFAULT;
/* this is kind of an lwip addition to the standard sockets: we wait
for some time when failing to allocate a segment for the FIN */
#if LWIP_SO_SNDTIMEO
if (conn->send_timeout >= 0) {
close_timeout = conn->send_timeout;
}
#endif /* LWIP_SO_SNDTIMEO */
Attached patch fixes the issue
_______________________________________________________
File Attachments:
-------------------------------------------------------
Date: Thu 17 Dec 2015 04:05:55 PM GMT Name:
0001-Fix-blocking-close-with-LWIP_SO_SNDTIMEO.patch Size: 1kB By:
jcunningham
<http://savannah.nongnu.org/bugs/download.php?file_id=35779>
_______________________________________________________
Reply to this item at:
<http://savannah.nongnu.org/bugs/?46704>
_______________________________________________
Message sent via/by Savannah
http://savannah.nongnu.org/
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [lwip-devel] [bug #46704] Fix blocking close with LWIP_SO_SNDTIMEO,
Joel Cunningham <=