mirror of
https://github.com/espressif/esp-idf.git
synced 2025-09-30 19:19:21 +00:00
feat(dhcps): Support for multiple DNS servers
This commit is contained in:

committed by
Abhik Roy

parent
d65d2fd4d1
commit
0fd3984c72
@@ -1990,11 +1990,11 @@ static esp_err_t esp_netif_set_dns_info_api(esp_netif_api_msg_t *msg)
|
||||
if (esp_netif && esp_netif->flags & ESP_NETIF_DHCP_SERVER) {
|
||||
#if ESP_DHCPS
|
||||
// if DHCP server configured to set DNS in dhcps API
|
||||
if (type != ESP_NETIF_DNS_MAIN) {
|
||||
if (type >= ESP_NETIF_DNS_FALLBACK) {
|
||||
ESP_LOGD(TAG, "set dns invalid type");
|
||||
return ESP_ERR_ESP_NETIF_INVALID_PARAMS;
|
||||
} else {
|
||||
dhcps_dns_setserver(esp_netif->dhcps, &lwip_ip);
|
||||
dhcps_dns_setserver(esp_netif->dhcps, &lwip_ip, (dns_type_t)type);
|
||||
}
|
||||
#else
|
||||
LOG_NETIF_DISABLED_AND_DO("DHCP Server", return ESP_ERR_NOT_SUPPORTED);
|
||||
@@ -2053,7 +2053,7 @@ static esp_err_t esp_netif_get_dns_info_api(esp_netif_api_msg_t *msg)
|
||||
if (esp_netif && esp_netif->flags & ESP_NETIF_DHCP_SERVER) {
|
||||
#if ESP_DHCPS
|
||||
ip4_addr_t dns_ip;
|
||||
dhcps_dns_getserver(esp_netif->dhcps, &dns_ip);
|
||||
dhcps_dns_getserver(esp_netif->dhcps, &dns_ip, (dns_type_t)type);
|
||||
memcpy(&dns->ip.u_addr.ip4, &dns_ip, sizeof(ip4_addr_t));
|
||||
dns->ip.type = ESP_IPADDR_TYPE_V4;
|
||||
#else
|
||||
|
Reference in New Issue
Block a user