lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] How to renew DHCP


From: Alain Mouette
Subject: Re: [lwip-users] How to renew DHCP
Date: Fri, 05 Feb 2010 00:44:14 -0200
User-agent: Thunderbird 2.0.0.23 (X11/20090812)

Just to have it documented, if anyone else needs it:

address@hidden escreveu:

Calling netif_set_down() and dhcp_start() would work, too, but might lead to getting a different address (dhcp_renew() can re-request the old address if the server still allows it).

This how it worked for me:

        netifapi_dhcp_stop(&lwip_netif);
        netif_set_down(&lwip_netif);
        ip_addr.addr  = 0x00000000;                                             
        net_mask.addr = 0x00000000;
        gw_addr.addr  = 0x00000000;
        netif_set_addr(&lwip_netif, &ip_addr, &net_mask, &gw_addr);
        netifapi_dhcp_start(&lwip_netif);
        do{
                vTaskDelay(100);
        }while (!netif_is_up(&lwip_netif));

Alain




reply via email to

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