]> git.sur5r.net Git - openldap/blobdiff - libraries/libldap/os-ip.c
Sync with HEAD
[openldap] / libraries / libldap / os-ip.c
index dfa3c65650c3148eb90a8b8c89812ba4e1f564c0..dad33ed000da23d5e89af2845a49c8756c719e14 100644 (file)
@@ -2,7 +2,7 @@
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 1998-2004 The OpenLDAP Foundation.
+ * Copyright 1998-2005 The OpenLDAP Foundation.
  * Portions Copyright 1999 Lars Uffmann.
  * All rights reserved.
  *
@@ -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