patch #6865: use so_options SOF_REUSEADDR instead of flags TF_REUSEADDR (which has ben removed again)

This commit is contained in:
goldsimon 2010-02-12 16:32:31 +00:00
parent bd3f86e505
commit 8768e4488a
3 changed files with 3 additions and 4 deletions

View File

@ -20,8 +20,8 @@ HISTORY
++ New features:
2010-02-12: Simon Goldschmidt/Jeff Barber
* tcp.c/h: patch #6865 (SO_REUSEADDR for TCP): if tcp_pcb.flags has
TF_REUSEADDR set, allow binding to endpoint in TIME_WAIT
* tcp.c/h: patch #6865 (SO_REUSEADDR for TCP): if pcb.so_options has
SOF_REUSEADDR set, allow binding to endpoint in TIME_WAIT
2010-02-12: Simon Goldschmidt
* sys layer: task #10139 (Prefer statically allocated memory): converted

View File

@ -319,7 +319,7 @@ tcp_bind(struct tcp_pcb *pcb, ip_addr_t *ipaddr, u16_t port)
}
/* Unless the REUSEADDR flag is set,
* we have to check the pcbs in TIME-WAIT state, also: */
if ((pcb->flags & TF_REUSEADDR) == 0) {
if ((pcb->so_options & SOF_REUSEADDR) == 0) {
for(cpcb = tcp_tw_pcbs; cpcb != NULL; cpcb = cpcb->next) {
if (cpcb->local_port == port) {
if (ip_addr_isany(&(cpcb->local_ip)) ||

View File

@ -370,7 +370,6 @@ struct tcp_pcb {
#define TF_ACK_NOW ((u8_t)0x02U) /* Immediate ACK. */
#define TF_INFR ((u8_t)0x04U) /* In fast recovery. */
#define TF_TIMESTAMP ((u8_t)0x08U) /* Timestamp option enabled */
#define TF_REUSEADDR ((u8_t)0x10U) /* Bind to endpoint in TIME_WAIT */
#define TF_FIN ((u8_t)0x20U) /* Connection was closed locally (FIN segment enqueued). */
#define TF_NODELAY ((u8_t)0x40U) /* Disable Nagle algorithm */
#define TF_NAGLEMEMERR ((u8_t)0x80U) /* nagle enabled, memerr, try to output to prevent delayed ACK to happen */