[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lwip-devel] [patch #6865] SO_REUSEADDR for TCP
From: |
Jeff Barber |
Subject: |
[lwip-devel] [patch #6865] SO_REUSEADDR for TCP |
Date: |
Tue, 14 Jul 2009 15:22:06 +0000 |
User-agent: |
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.11) Gecko/2009060215 Firefox/3.0.11 |
URL:
<http://savannah.nongnu.org/patch/?6865>
Summary: SO_REUSEADDR for TCP
Project: lwIP - A Lightweight TCP/IP stack
Submitted by: jeffbabar
Submitted on: Tue 14 Jul 2009 03:22:04 PM GMT
Category: None
Priority: 5 - Normal
Status: None
Privacy: Public
Assigned to: None
Originator Email:
Open/Closed: Open
Discussion Lock: Any
Planned Release: None
_______________________________________________________
Details:
In developing an FTP server (for example) it is necessary to bind each
outgoing PORT connection to the well-known FTP-data port (20). Back-to-back
transfers usually mean that the second and subsequent connections need to be
bound to port 20 while the previous PCB is still in TIME_WAIT. Hence, the
equivalent of SO_REUSEADDR required in order to implement the server.
This patch provides a new TCP flag "TF_REUSEADDR" that, when set during the
processing of tcp_bind, bypasses the checking of the PCBs still in TIME_WAIT.
Applies cleanly to top-of-tree and 1.3.1-RC1. It does not apply cleanly to
1.3.0 but the sole failure is the one line definition of the new flag and is
trivial to fix.
Usage:
pcb = tcp_new();
pcb->flags |= TF_REUSEADDR;
status = tcp_bind(pcb, &in_addr_any, FTP_DATA_PORT);
...
Sorry, I only use the raw API with NO_SYS=1 so I can't provide a patch that
works for other APIs.
_______________________________________________________
File Attachments:
-------------------------------------------------------
Date: Tue 14 Jul 2009 03:22:04 PM GMT Name: tcp_reuseaddr.patch Size: 2kB
By: jeffbabar
<http://savannah.nongnu.org/patch/download.php?file_id=18422>
_______________________________________________________
Reply to this item at:
<http://savannah.nongnu.org/patch/?6865>
_______________________________________________
Message sent via/by Savannah
http://savannah.nongnu.org/
- [lwip-devel] [patch #6865] SO_REUSEADDR for TCP,
Jeff Barber <=