Skip to content

Commit 59ec204

Browse files
authored
Merge pull request #860 from JAndrassy/ethernet_static_dns_to_netif
Ethernet begin with static IP - set DNS with interface name
2 parents 4930554 + dd866da commit 59ec204

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

libraries/Ethernet/src/Ethernet.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,9 @@ int arduino::EthernetClass::begin(uint8_t *mac, IPAddress ip, IPAddress dns, IPA
5555

5656
eth_if->set_dhcp(false);
5757
eth_if->set_network(_ip, _netmask, _gateway);
58-
eth_if->add_dns_server(_dnsServer1, nullptr);
58+
char if_name[5];
59+
eth_if->get_interface_name(if_name);
60+
eth_if->add_dns_server(_dnsServer1, if_name);
5961

6062
auto ret = _begin(mac, timeout, responseTimeout);
6163
return ret;

0 commit comments

Comments
 (0)