We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see ourdocumentation.
There was an error while loading.Please reload this page.
1 parent333bfff commit893dba5Copy full SHA for 893dba5
libraries/Network/src/NetworkInterface.cpp
@@ -352,7 +352,7 @@ bool NetworkInterface::enableIPv6(bool en) {
352
}
353
354
boolNetworkInterface::dnsIP(uint8_t dns_no, IPAddress ip) {
355
-if (_esp_netif ==NULL || dns_no >2) {
+if (_esp_netif ==NULL || dns_no >= ESP_NETIF_DNS_MAX) {
356
returnfalse;
357
358
esp_netif_flags_t flags =esp_netif_get_flags(_esp_netif);
@@ -708,11 +708,11 @@ IPAddress NetworkInterface::gatewayIP() const {
708
709
710
IPAddressNetworkInterface::dnsIP(uint8_t dns_no)const {
711
-if (_esp_netif ==NULL) {
712
returnIPAddress();
713
714
esp_netif_dns_info_t d;
715
-if (esp_netif_get_dns_info(_esp_netif, dns_no ? ESP_NETIF_DNS_BACKUP : ESP_NETIF_DNS_MAIN, &d) != ESP_OK) {
+if (esp_netif_get_dns_info(_esp_netif,(esp_netif_dns_type_t)dns_no, &d) != ESP_OK) {
716
717
718
if (d.ip.type == ESP_IPADDR_TYPE_V6) {