]> granicus.if.org Git - esp-idf/commitdiff
fix the dhcps default behaviour chenged by dns
authorzhangyanjiao <zhangyanjiao@espressif.com>
Tue, 28 Nov 2017 08:14:35 +0000 (16:14 +0800)
committerzhangyanjiao <zhangyanjiao@espressif.com>
Tue, 28 Nov 2017 08:39:00 +0000 (16:39 +0800)
Closes https://github.com/espressif/esp-idf/issues/1285

components/lwip/apps/dhcpserver.c
components/tcpip_adapter/tcpip_adapter_lwip.c

index 7062b4456edf79e0c79d4a219a21cc940d8555cd..1cb191b869df95d0bea521ef38b8f730aca578ef 100644 (file)
@@ -94,7 +94,7 @@ static bool renew = false;
 static dhcps_lease_t dhcps_poll;
 static dhcps_time_t dhcps_lease_time = DHCPS_LEASE_TIME_DEF;  //minute
 static dhcps_offer_t dhcps_offer = 0xFF;
-static dhcps_offer_t dhcps_dns = 0xFF;
+static dhcps_offer_t dhcps_dns = 0x00;
 
 /******************************************************************************
  * FunctionName : dhcps_option_info
index b5fe5dce572d2328b6af677e351f27cdb25f4709..97511cb9da34854a10bb03d230ed7427bbe4cf54 100644 (file)
@@ -408,7 +408,7 @@ esp_err_t tcpip_adapter_set_ip_info(tcpip_adapter_if_t tcpip_if, tcpip_adapter_i
 
     if (p_netif != NULL && netif_is_up(p_netif)) {
         netif_set_addr(p_netif, &ip_info->ip, &ip_info->netmask, &ip_info->gw);
-        if (!(ip4_addr_isany_val(ip_info->ip) || ip4_addr_isany_val(ip_info->ip) || ip4_addr_isany_val(ip_info->ip))) {
+        if (!(ip4_addr_isany_val(ip_info->ip) || ip4_addr_isany_val(ip_info->netmask) || ip4_addr_isany_val(ip_info->gw))) {
             system_event_t evt;
             evt.event_id = SYSTEM_EVENT_STA_GOT_IP;
             evt.event_info.got_ip.ip_changed = false;