fix DNS issue caused by HTON macro weirdness on 32bits + fix inet_aton()
This commit is contained in:
parent
cfa28a9a75
commit
25e81d7cf1
|
@ -58,8 +58,7 @@ int DNSClient::inet_aton(const char* aIPAddrString, IPAddress& aResult)
|
||||||
{
|
{
|
||||||
// See if we've been given a valid IP address
|
// See if we've been given a valid IP address
|
||||||
const char* p =aIPAddrString;
|
const char* p =aIPAddrString;
|
||||||
while (*p &&
|
while (*p && ( (*p == '.') || ((*p >= '0') && (*p <= '9')) ))
|
||||||
( (*p == '.') || (*p >= '0') || (*p <= '9') ))
|
|
||||||
{
|
{
|
||||||
p++;
|
p++;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#ifndef UTIL_H
|
#ifndef UTIL_H
|
||||||
#define UTIL_H
|
#define UTIL_H
|
||||||
|
|
||||||
#define htons(x) ( ((x)<<8) | (((x)>>8)&0xFF) )
|
#define htons(x) ( ((x)<< 8 & 0xFF00) | ((x)>> 8 & 0x00FF) )
|
||||||
#define ntohs(x) htons(x)
|
#define ntohs(x) htons(x)
|
||||||
|
|
||||||
#define htonl(x) ( ((x)<<24 & 0xFF000000UL) | \
|
#define htonl(x) ( ((x)<<24 & 0xFF000000UL) | \
|
||||||
|
|
Loading…
Reference in New Issue