According to the wiki, the correct way to initialize a DHCP interface is
to call dhcp_start() and not netif_set_up(). So, summarizing:
you can poll for netif.dhcp-state == DHCP_BOUND
you can define LWIP_NETIF_STATUS_CALLBACK, and call
void netif_set_status_callback(struct netif *netif,
Chris,
I am using the TCP RAW. After starting DHCP I wait for the IP by using:
While(main_netif.dchp-state != DHCP_BOUND). After the state changes to
DHCP_BOUND the ip is in the pcb (main_netif.ip_addr). You can periodically
check to see if the ip changes. I also include in the while statement
When I did it, I basically polled for
netif.dhcp-state == DHCP_BOUND
and read
ipaddr = netif.ip_addr;
netmask = netif.netmask;
gw = netif.gw;
but now I realize the dhcp code calls netif_set_up() when it reaches
that state, which also calls NETIF_STATUS_CALLBACK if