diff --git a/components/lwip/apps/dhcpserver.c b/components/lwip/apps/dhcpserver.c index c5ce7a8ad..bc3cfda73 100644 --- a/components/lwip/apps/dhcpserver.c +++ b/components/lwip/apps/dhcpserver.c @@ -1074,7 +1074,7 @@ void dhcps_start(struct netif *netif, ip4_addr_t ip) client_address_plus.addr = dhcps_poll.start_ip.addr; - udp_bind(pcb_dhcps, IP_ADDR_ANY, DHCPS_SERVER_PORT); + udp_bind(pcb_dhcps, &netif->ip_addr, DHCPS_SERVER_PORT); udp_recv(pcb_dhcps, handle_dhcp, NULL); #if DHCPS_DEBUG DHCPS_LOG("dhcps:dhcps_start->udp_recv function Set a receive callback handle_dhcp for UDP_PCB pcb_dhcps\n"); diff --git a/components/tcpip_adapter/tcpip_adapter_lwip.c b/components/tcpip_adapter/tcpip_adapter_lwip.c index d385fd418..86fe8dbfb 100644 --- a/components/tcpip_adapter/tcpip_adapter_lwip.c +++ b/components/tcpip_adapter/tcpip_adapter_lwip.c @@ -309,6 +309,8 @@ esp_err_t tcpip_adapter_down(tcpip_adapter_if_t tcpip_if) tcpip_adapter_start_ip_lost_timer(tcpip_if); } + tcpip_adapter_update_default_netif(); + return ESP_OK; }