Skip to content

Commit

Permalink
Fixed bug for stop dhcps before set dns
Browse files Browse the repository at this point in the history
Closes #10762
  • Loading branch information
freakyxue authored and muhaidong committed Jun 12, 2023
1 parent f0b1869 commit a21312a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions examples/mesh/ip_internal_network/main/mesh_netif.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,10 @@ static esp_err_t set_dhcps_dns(esp_netif_t *netif, uint32_t addr)
dns.ip.u_addr.ip4.addr = addr;
dns.ip.type = IPADDR_TYPE_V4;
dhcps_offer_t dhcps_dns_value = OFFER_DNS;
ESP_ERROR_CHECK_WITHOUT_ABORT(esp_netif_dhcps_stop(netif));
ESP_ERROR_CHECK(esp_netif_dhcps_option(netif, ESP_NETIF_OP_SET, ESP_NETIF_DOMAIN_NAME_SERVER, &dhcps_dns_value, sizeof(dhcps_dns_value)));
ESP_ERROR_CHECK(esp_netif_set_dns_info(netif, ESP_NETIF_DNS_MAIN, &dns));
ESP_ERROR_CHECK_WITHOUT_ABORT(esp_netif_dhcps_start(netif));
return ESP_OK;
}

Expand Down

0 comments on commit a21312a

Please sign in to comment.