lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-users] lwip 1.3.0 dhcp_fine_tmr minor issue


From: B B
Subject: [lwip-users] lwip 1.3.0 dhcp_fine_tmr minor issue
Date: Fri, 25 Apr 2008 12:15:52 +0200

 
Hi List,
 
I have been working with lwip 1.3.0 and FreeRTOS. Which now seems to work wonderfully.
 
But i have observed a minor problem with DHCP. On a few occasions i have experienced that
the program gets stuck in dhcp_fine_tmr(). The reason for this is that dhcp_start() hasn't been called yet.
 
In lwip 1.2.0 i called dhcp_start() and set the appropiate timers afterwards. But these timers are now started
by the tcpip_thread. Which means they are started before a call to dhcp_start() has been made.
 
So netif is != NULL, netif->next points to netif (only one netif) and netif->dhcp is = NULL.
This get you stuck in the while loop.
 
This could be prevented by adding an extra if in function dhcp_fine_tmer():
 
void
dhcp_fine_tmr()
{
   struct netif *netif = netif_list;
   /* loop through netif's */
   while (netif != NULL) {
      /* only act on DHCP configured interfaces */
     if (netif->dhcp != NULL) {
     /* timer is active (non zero), and is about to trigger now */
     if (netif->dhcp->request_timeout > 1) {
         netif->dhcp->request_timeout--;
     }
     else if (netif->dhcp->request_timeout == 1) {
        netif->dhcp->request_timeout--;
        /* { netif->dhcp->request_timeout == 0 } */
        LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_fine_tmr(): request timeout\n"));
       /* this clients' request timeout triggered */
       dhcp_timeout(netif);
     }
    }
    /* proceed to next network interface */
    netif = netif->next;
 
    +if (netif == netif->next && netif->dhcp == NULL)
    +{
    +   break;
    +}
   }
}
 
maybe this should also be added to the dhcp_coarse_tmr() function.
 
best regards,
Martin


Discover the new Windows Vista Learn more!

reply via email to

[Prev in Thread] Current Thread [Next in Thread]