buglwIP - A Lightweight TCP/IP stack - Bugs: bug #20180, Bug in netif.c...

 
 

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

bug #20180: Bug in netif.c (netif_set_ipaddr(...))

Submitted by:  Alexander Drozd <alx_d>
Submitted on:  Sat 16 Jun 2007 12:47:37 AM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: Faulty BehaviourStatus: Fixed
Privacy: PublicAssigned to: Simon Goldschmidt <goldsimon>
Open/Closed: ClosedPlanned Release: None
lwIP version: None

Sat 16 Jun 2007 01:32:53 PM UTC, comment #3:

OK, with netif_add, I see the problem!

Fixed it. Thanks for reporting this!

Simon Goldschmidt <goldsimon>
Project AdministratorIn charge of this item.
Sat 16 Jun 2007 01:27:23 PM UTC, comment #2:

This bug appears, when we have listen pcbs for any addr and call netif_add. For example it is called from ppp (sifup(...)).

When netif_add calls netif_set_addr() (that calls netif_set_ipaddr()), netif->ip_addr.addr == 0, in that case addr from new netif is assigned for listen pcbs that listen any addr.

Alexander Drozd <alx_d>
Sat 16 Jun 2007 11:32:01 AM UTC, comment #1:

Does that mean you change the IP address of one of your netifs from IP_ADDR_ANY to a valid IP? In which situation? Does DHCP do it that way?

A little comment as to why you think it must be changed would help...

Simon Goldschmidt <goldsimon>
Project AdministratorIn charge of this item.
Sat 16 Jun 2007 12:47:37 AM UTC, original submission:

Bug in netif.c (netif_set_ipaddr(...)):

for (lpcb = tcp_listen_pcbs.listen_pcbs; lpcb != NULL; lpcb = lpcb->next) {
/* PCB bound to current local interface address? */

if (ip_addr_cmp(&(lpcb->local_ip), &(netif->ip_addr))) {
/* The PCB is listening to the old ipaddr and
* is set to listen to the new one instead */
ip_addr_set(&(lpcb->local_ip), ipaddr);
}
}

Must be:

for (lpcb = tcp_listen_pcbs.listen_pcbs; lpcb != NULL; lpcb = lpcb->next) {
/* PCB bound to current local interface address? */

if ((!(ip_addr_isany(&(lpcb->local_ip)))) && (ip_addr_cmp(&(lpcb->local_ip), &(netif->ip_addr)))) {
/* The PCB is listening to the old ipaddr and
* is set to listen to the new one instead */
ip_addr_set(&(lpcb->local_ip), ipaddr);
}
}

Alexander Drozd <alx_d>

 

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 alx_d (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
    Sat 16 Jun 2007 01:32:53 PM UTCgoldsimonStatusNone=>Fixed
      Assigned toNone=>goldsimon
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1