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(...))

Submitter:  Alexander Drozd <alx_d>
Submitted:  Sat 16 Jun 2007 12:47:37 AM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  Faulty Behaviour Status:  Fixed
Privacy:  Public Assigned to:  goldsimon
Open/Closed:  Closed Planned 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>
Group administrator
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>
Group administrator
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>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by goldsimon (Posted a comment)
  • -email is unavailable- added by alx_d (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2007-06-16 goldsimon StatusNone Fixed
        Assigned toNone goldsimon
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code