Ethernet: fixed upcast of byte-pointer

This commit is contained in:
Cristian Maglie 2014-10-28 17:55:52 +01:00
parent c1cca1fe54
commit 79fde3a636
1 changed files with 3 additions and 2 deletions

View File

@ -329,8 +329,9 @@ uint8_t DhcpClass::parseDHCPResponse(unsigned long responseTimeout, uint32_t& tr
case dhcpServerIdentifier :
opt_len = _dhcpUdpSocket.read();
if( *((uint32_t*)_dhcpDhcpServerIp) == 0 ||
IPAddress(_dhcpDhcpServerIp) == _dhcpUdpSocket.remoteIP() )
if ((_dhcpDhcpServerIp[0] == 0 && _dhcpDhcpServerIp[1] == 0 &&
_dhcpDhcpServerIp[2] == 0 && _dhcpDhcpServerIp[3] == 0) ||
IPAddress(_dhcpDhcpServerIp) == _dhcpUdpSocket.remoteIP())
{
_dhcpUdpSocket.read(_dhcpDhcpServerIp, sizeof(_dhcpDhcpServerIp));
}