Skip to content

Commit 9dca56d

Browse files
Don't use IPAddress::_address from EthernetClass
EthernetClass is a friend class of IPAddress, so it is allowed to use its _address attribute directly. However, it should be using IPAddress::raw_address() instead, like all the other friend classes do. This changes allows changing the _address attribute to fix some warnings next.
1 parent 5b83043 commit 9dca56d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Diff for: libraries/Ethernet/src/Ethernet.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@ void EthernetClass::begin(uint8_t *mac, IPAddress local_ip, IPAddress dns_server
6262
{
6363
W5100.init();
6464
W5100.setMACAddress(mac);
65-
W5100.setIPAddress(local_ip._address);
66-
W5100.setGatewayIp(gateway._address);
67-
W5100.setSubnetMask(subnet._address);
65+
W5100.setIPAddress(local_ip.raw_address());
66+
W5100.setGatewayIp(gateway.raw_address());
67+
W5100.setSubnetMask(subnet.raw_address());
6868
_dnsServerAddress = dns_server;
6969
}
7070

0 commit comments

Comments
 (0)