buglwIP - A Lightweight TCP/IP stack - Bugs: bug #30565, tcp_connect() check bound list

 
 

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

bug #30565: tcp_connect() check bound list

Submitted by:  Oleg Tyshev <olegreen>
Submitted on:  Tue 27 Jul 2010 02:01:38 PM UTC  
 
Category: TCPSeverity: 3 - Normal
Item Group: Faulty BehaviourStatus: Fixed
Privacy: PublicAssigned to: Simon Goldschmidt <goldsimon>
Open/Closed: ClosedPlanned Release: None
lwIP version: CVS Head

Wed 28 Jul 2010 04:49:55 PM UTC, comment #2:

Fixed, thanks for reporting. On passive open, the 5-tuple is ensured to be unique by the fact that we first check all other list for a match before passing a SYN to a listening PCB.

Simon Goldschmidt <goldsimon>
Project AdministratorIn charge of this item.
Tue 27 Jul 2010 08:05:16 PM UTC, comment #1:

Hmm, seems you're right on this: the current code will really never be true for bound pcbs.

Simon Goldschmidt <goldsimon>
Project AdministratorIn charge of this item.
Tue 27 Jul 2010 02:01:38 PM UTC, original submission:

In this code fragment will be checked
bound pcbs list,
active pcbs list and
time-wait pcbs list

tcp_connect(...)
{
...
/* Don't check listen PCBs, check bound-, active- and TIME-WAIT PCBs. */
for (i = 1; i < NUM_TCP_PCB_LISTS; i++) {
for(cpcb = *tcp_pcb_lists[i]; cpcb != NULL; cpcb = cpcb->next) {
if ((cpcb->local_port == pcb->local_port) &&
(cpcb->remote_port == port) &&
ip_addr_cmp(&cpcb->local_ip, &pcb->local_ip) &&
ip_addr_cmp(&cpcb->remote_ip, ipaddr)) {
/* linux returns EISCONN here, but ERR_USE should be OK for us */
return ERR_USE;
}
}

But for bound pcbs list compare of the remote ip and port will be allways false.
So, instead of
for (i = 1; i < NUM_TCP_PCB_LISTS; i++) {
will be better write
for (i = 2; i < NUM_TCP_PCB_LISTS; i++) {

Oleg Tyshev <olegreen>

 

No files currently attached

 

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 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 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 28 Jul 2010 04:49:55 PM UTCgoldsimonStatusNone=>Fixed
      Assigned toNone=>goldsimon
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1