lwip/dhcp: change de-initialization value of netmask
Netmask of IP_ADDR_ANY is 0.0.0.0, it causes wrong netif assignment due
to wrong ip address comparsion with 0.0.0.0 netmask. ip_route may not
work properly with netmask 0.0.0.0.
@@ -1211,9 +1211,11 @@ void dhcp_stop(struct netif *netif)
}
#endif /* LWIP_DHCP_AUTOIP_COOP */
+ ip_addr_t ipaddr;
netif_set_ipaddr(netif, IP_ADDR_ANY);
netif_set_gw(netif, IP_ADDR_ANY);
- netif_set_netmask(netif, IP_ADDR_ANY);
+ ipaddr.addr = IPADDR_NONE;
+ netif_set_netmask(netif, &ipaddr);
if (dhcp->pcb != NULL) {
udp_remove(dhcp->pcb);
