Merge branch 'bugfix/bind_dhcp_server_udp_to_ip_of_ap' into 'master'

Fix the bug that if one device is in station+softap mode, other device can not get IP address after connecting to the softap.

See merge request !1314
This commit is contained in:
Ivan Grokhotkov 2017-09-26 16:06:55 +08:00
commit b7a79ab67e
2 changed files with 3 additions and 1 deletions

View File

@ -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");

View File

@ -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;
}