From 6b2dec0d01217675daf124a9dea2d0650d88225b Mon Sep 17 00:00:00 2001 From: amcewen Date: Thu, 7 Jul 2011 21:59:35 +0100 Subject: [PATCH] Fixed bug where the DHCP client didn't correctly handle a response containing more than one DNS server address. Fixes issue 569. --- libraries/Ethernet/Dhcp.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/libraries/Ethernet/Dhcp.cpp b/libraries/Ethernet/Dhcp.cpp index c20d2e61d..29db89098 100755 --- a/libraries/Ethernet/Dhcp.cpp +++ b/libraries/Ethernet/Dhcp.cpp @@ -271,11 +271,19 @@ uint8_t DhcpClass::parseDHCPResponse(unsigned long responseTimeout, uint32_t& tr case routersOnSubnet : opt_len = _dhcpUdpSocket.read(); _dhcpUdpSocket.read(_dhcpGatewayIp, 4); + for (int i = 0; i < opt_len-4; i++) + { + _dhcpUdpSocket.read(); + } break; case dns : opt_len = _dhcpUdpSocket.read(); _dhcpUdpSocket.read(_dhcpDnsServerIp, 4); + for (int i = 0; i < opt_len-4; i++) + { + _dhcpUdpSocket.read(); + } break; case dhcpServerIdentifier :