]> granicus.if.org Git - apache/commitdiff
Not all platforms have INADDR_NONE defined by default. Apache used to
authorRyan Bloom <rbb@apache.org>
Sat, 11 Nov 2000 06:06:00 +0000 (06:06 +0000)
committerRyan Bloom <rbb@apache.org>
Sat, 11 Nov 2000 06:06:00 +0000 (06:06 +0000)
check for this and the define it if needed.  Since APR also needs this
check it makes more sense for APR to just check and export a symobl that
is always available.
Submitted by: Branko �ibej <brane@xbc.nu>
Reviewed by: Ryan Bloom

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86919 13f79535-47bb-0310-9956-ffa450edef68

acinclude.m4
configure.in
modules/aaa/mod_access.c
modules/proxy/proxy_util.c
server/util.c

index e4349a44866eb645fa91503d115a06e0a10ae427..63d40ec3aa9d6e99c54add17fa8fa418ca3ad2c4 100644 (file)
@@ -176,38 +176,6 @@ AC_DEFUN(APACHE_ONCE,[
 sinclude(lib/apr/apr_common.m4)
 sinclude(lib/apr/hints.m4)
 
-dnl
-dnl APACHE_INADDR_NONE
-dnl
-dnl checks for missing INADDR_NONE macro
-dnl
-AC_DEFUN(APACHE_INADDR_NONE,[
-  AC_CACHE_CHECK(whether system defines INADDR_NONE, ac_cv_inaddr_none,[
-  AC_TRY_COMPILE([
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#ifdef HAVE_SYS_SOCKET_H
-#include <sys/socket.h>
-#endif
-#ifdef HAVE_NETINET_IN_H
-#include <netinet/in.h>
-#endif
-#ifdef HAVE_ARPA_INET_H
-#include <arpa/inet.h>
-#endif
-],[
-unsigned long foo = INADDR_NONE;
-],[
-    ac_cv_inaddr_none=yes
-],[
-    ac_cv_inaddr_none=no
-])])
-  if test "$ac_cv_inaddr_none" = "no"; then    
-    AC_DEFINE(INADDR_NONE, ((unsigned int) 0xffffffff), [ ])
-  fi
-])
-
 AC_DEFUN(APACHE_CHECK_SIGWAIT_ONE_ARG,[
   AC_CACHE_CHECK(whether sigwait takes one argument,ac_cv_sigwait_one_arg,[
   AC_TRY_COMPILE([
index 3e662fbdb0a316a89028a531df4c2bdad76eb603..95648149baa4cdab6d626f527f02ded8baf87467 100644 (file)
@@ -102,8 +102,6 @@ AC_CHECK_LIB(nsl, gethostname)
 AC_CHECK_LIB(socket, socket)
 AC_CHECK_LIB(resolv, sethostent)
 
-APACHE_INADDR_NONE
-
 APACHE_EBCDIC
 
 AC_ARG_WITH(optim,[  --with-optim="FLAGS"      compiler optimisation flags],
index 500d2eab63ddf307197be35204fc6f0b0a03af38..4efa4b87aabc0b3cbf3af0d2b56645fef26d4800 100644 (file)
@@ -193,7 +193,7 @@ static const char *allow_cmd(cmd_parms *cmd, void *dv, const char *from,
        *s++ = '\0';
 
        if (!is_ip(where)
-           || (a->x.ip.net = apr_inet_addr(where)) == INADDR_NONE) {
+           || (a->x.ip.net = apr_inet_addr(where)) == APR_INADDR_NONE) {
            a->type = T_FAIL;
            return "syntax error in network portion of network/netmask";
        }
@@ -206,7 +206,7 @@ static const char *allow_cmd(cmd_parms *cmd, void *dv, const char *from,
        /* is it in /a.b.c.d form? */
        if (strchr(s, '.')) {
            mask = apr_inet_addr(s);
-           if (mask == INADDR_NONE) {
+           if (mask == APR_INADDR_NONE) {
                a->type = T_FAIL;
                return "syntax error in mask portion of network/netmask";
            }
@@ -334,7 +334,7 @@ static int find_allowdeny(request_rec *r, apr_array_header_t *a, int method)
            return 1;
 
        case T_IP:
-           if (ap[i].x.ip.net != INADDR_NONE
+           if (ap[i].x.ip.net != APR_INADDR_NONE
                && (r->connection->remote_addr.sin_addr.s_addr
                    & ap[i].x.ip.mask) == ap[i].x.ip.net) {
                return 1;
index 49faecd82d905855b3b521f4aad2ec2e0d006023..5b6a18331ff07b54570e7854b856a042567a6a92 100644 (file)
@@ -885,7 +885,7 @@ int ap_proxy_is_ipaddr(struct dirconn_entry *This, apr_pool_t *p)
             inet_ntoa(This->addr), bits);
     }
 
-    This->mask.s_addr = htonl(INADDR_NONE << (32 - bits));
+    This->mask.s_addr = htonl(APR_INADDR_NONE << (32 - bits));
 
     if (*addr == '\0' && (This->addr.s_addr & ~This->mask.s_addr) != 0) {
     ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL, "Warning: NetMask and IP-Addr disagree in %s/%ld",
index 986c9dde718de7ad70da524400aa4241267d4368..2cd50866c2f49b7cc9ab864289ef5194cbf0e489 100644 (file)
@@ -1868,7 +1868,7 @@ unsigned long ap_get_virthost_addr(char *w, apr_port_t *ports)
     }
 
     my_addr = apr_inet_addr((char *)w);
-    if (my_addr != INADDR_NONE) {
+    if (my_addr != APR_INADDR_NONE) {
        if (p != NULL)
            *p = ':';
        return my_addr;