Skip to content

Commit e782493

Browse files
committed
Fix for compiling with esp-idf v3.3.2
Incorporates a patch from @IvanPorro: espressif#3760 (comment) I don't know whether this will compile with <3.3.2, as the API has changed.
1 parent 37a7fb3 commit e782493

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Diff for: libraries/WiFi/src/ETH.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -193,8 +193,8 @@ IPAddress ETHClass::gatewayIP()
193193

194194
IPAddress ETHClass::dnsIP(uint8_t dns_no)
195195
{
196-
ip_addr_t dns_ip = dns_getserver(dns_no);
197-
return IPAddress(dns_ip.u_addr.ip4.addr);
196+
const ip_addr_t * dns_ip = dns_getserver(dns_no);
197+
return IPAddress(dns_ip->u_addr.ip4.addr);
198198
}
199199

200200
IPAddress ETHClass::broadcastIP()

Diff for: libraries/WiFi/src/WiFiSTA.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -488,8 +488,8 @@ IPAddress WiFiSTAClass::dnsIP(uint8_t dns_no)
488488
if(WiFiGenericClass::getMode() == WIFI_MODE_NULL){
489489
return IPAddress();
490490
}
491-
ip_addr_t dns_ip = dns_getserver(dns_no);
492-
return IPAddress(dns_ip.u_addr.ip4.addr);
491+
const ip_addr_t * dns_ip = dns_getserver(dns_no);
492+
return IPAddress(dns_ip->u_addr.ip4.addr);
493493
}
494494

495495
/**

0 commit comments

Comments
 (0)