buglwIP - A Lightweight TCP/IP stack - Bugs: bug #21080, tcp_bind without check pcbs in...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #21080: tcp_bind without check pcbs in TIME_WAIT state

Submitted by:  Oleg Tyshev <olegreen>
Submitted on:  Fri 14 Sep 2007 03:36:17 PM UTC  
 
Category: TCPSeverity: 3 - Normal
Item Group: Faulty BehaviourStatus: Fixed
Privacy: PublicAssigned to: Simon Goldschmidt <goldsimon>
Open/Closed: ClosedPlanned Release: None
lwIP version: None

Thu 20 Sep 2007 06:28:51 PM UTC, comment #3:

Fixed by including the check suggested by oleg

Simon Goldschmidt <goldsimon>
Project AdministratorIn charge of this item.
Thu 20 Sep 2007 04:01:26 PM UTC, comment #2:

Yep. Anyone against me implementing this? (with a @todo directing to the task)

Simon Goldschmidt <goldsimon>
Project AdministratorIn charge of this item.
Sat 15 Sep 2007 07:08:14 AM UTC, comment #1:

The idea seems correct.

Frédéric Bernon <fbernon>
Project Member
Fri 14 Sep 2007 03:36:17 PM UTC, original submission:

In revision 1.32 of the file tcp.c was introduced
conditional switch SO_REUSE and following code

for(cpcb = tcp_tw_pcbs; cpcb != NULL; cpcb = cpcb->next) {
if(cpcb->local_port == port) {
if(ip_addr_cmp(&(cpcb->local_ip), ipaddr)) {
if(!(pcb->so_options & SOF_REUSEADDR) && !(pcb->so_options & SOF_REUSEPORT)) {
LWIP_DEBUGF(TCP_DEBUG, ("tcp_bind: in TIME_WAIT PCB's SO_REUSEPORT or SO_REUSEADDR not set and same address.\n"));
return ERR_USE;
}
else if(pcb->so_options & SOF_REUSEPORT) {
LWIP_DEBUGF(TCP_DEBUG, ("tcp_bind: in TIME_WAIT PCB's SO_REUSEPORT set and same address.\n"));
reuse_port_all_set = (reuse_port_all_set && (cpcb->so_options & SOF_REUSEPORT));
}
}
}
}
Later, all that had any connection to SO_REUSEADDR was deleted.
We have now only task #6995: Implement SO_REUSEADDR
https://savannah.nongnu.org/task/?6995

But if we don not support SO_REUSEADDR now,
we should check tcp_tw_pcbs list too.
Tcp_bind should contain something like that:

for (cpcb = tcp_tw_pcbs;
cpcb != NULL; cpcb = cpcb->next) {
if (cpcb->local_port == port &&
ip_addr_cmp(&(cpcb->local_ip), ipaddr)) {
return ERR_USE;
}
}

Oleg Tyshev <olegreen>

 

Attached Files
file #13945:  tcp_bind.patch added by olegreen (492B - text/x-patch)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by goldsimon (Posted a comment)
  • -unavailable- added by fbernon (Posted a comment)
  • -unavailable- added by olegreen (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 20 Sep 2007 06:28:51 PM UTCgoldsimonStatusNone=>Fixed
      Assigned toNone=>goldsimon
      Open/ClosedOpen=>Closed
    Fri 14 Sep 2007 03:36:17 PM UTColegreenAttached File-=>Added tcp_bind.patch, #13945

    Back to the top


    Powered by Savane 3.1-cleanup1