From: Kurt Zeilenga Date: Fri, 31 Dec 2004 12:02:23 +0000 (+0000) Subject: inet_addr cleanup X-Git-Tag: OPENLDAP_REL_ENG_2_3_0ALPHA~3^2~1 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=83b1ce98318e193931ff15fe6ba92f6044b54ab3;p=openldap inet_addr cleanup --- diff --git a/libraries/libldap/os-ip.c b/libraries/libldap/os-ip.c index dfa3c65650..5aead88019 100644 --- a/libraries/libldap/os-ip.c +++ b/libraries/libldap/os-ip.c @@ -349,11 +349,14 @@ int ldap_pvt_inet_aton( const char *host, struct in_addr *in) { unsigned long u = inet_addr( host ); - if ( u != 0xffffffff || u != (unsigned long) -1 ) { - in->s_addr = u; - return 1; - } - return 0; + +#ifdef INADDR_NONE + if ( u == INADDR_NONE ) return 0; +#endif + if ( u == 0xffffffffUL || u == (unsigned long) -1L ) return 0; + + in->s_addr = u; + return 1; } #endif