Skip to content

Commit 6b2dec0

Browse files
committed
Fixed bug where the DHCP client didn't correctly handle a response containing more than one DNS server address. Fixes issue 569.
1 parent ffd2cec commit 6b2dec0

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

libraries/Ethernet/Dhcp.cpp

+8
Original file line numberDiff line numberDiff line change
@@ -271,11 +271,19 @@ uint8_t DhcpClass::parseDHCPResponse(unsigned long responseTimeout, uint32_t& tr
271271
case routersOnSubnet :
272272
opt_len = _dhcpUdpSocket.read();
273273
_dhcpUdpSocket.read(_dhcpGatewayIp, 4);
274+
for (int i = 0; i < opt_len-4; i++)
275+
{
276+
_dhcpUdpSocket.read();
277+
}
274278
break;
275279

276280
case dns :
277281
opt_len = _dhcpUdpSocket.read();
278282
_dhcpUdpSocket.read(_dhcpDnsServerIp, 4);
283+
for (int i = 0; i < opt_len-4; i++)
284+
{
285+
_dhcpUdpSocket.read();
286+
}
279287
break;
280288

281289
case dhcpServerIdentifier :

0 commit comments

Comments
 (0)