httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r..@locus.apache.org
Subject cvs commit: apache-2.0/src/modules/standard mod_access.c
Date Sat, 11 Nov 2000 06:06:01 GMT
rbb         00/11/10 22:06:00

  Modified:    src      CHANGES acinclude.m4 configure.in
               src/lib/apr aclocal.m4 configure.in
               src/lib/apr/include apr.h.in
               src/lib/apr/network_io/unix sa_common.c
               src/lib/apr/network_io/win32 sockaddr.c
               src/main util.c
               src/modules/proxy proxy_util.c
               src/modules/standard mod_access.c
  Log:
  Not all platforms have INADDR_NONE defined by default.  Apache used to
  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
  
  Revision  Changes    Path
  1.318     +6 -0      apache-2.0/src/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/CHANGES,v
  retrieving revision 1.317
  retrieving revision 1.318
  diff -u -r1.317 -r1.318
  --- CHANGES	2000/11/10 13:21:12	1.317
  +++ CHANGES	2000/11/11 06:05:57	1.318
  @@ -1,4 +1,10 @@
   Changes with Apache 2.0a8
  +  *) Not all platforms have INADDR_NONE defined by default.  Apache
  +     used to make this check and define INADDR_NONE if appropriate,
  +     but APR needs the check too, and I suspect other applications will
  +     as well.  APR now defines APR_INADDR_NONE, which is always a valid
  +     value on all platforms.
  +     [Branko Čibej <brane@xbc.nu>]
   
     *) Destroy the pthread mutex in lock_intra_cleanup() for PR#6824.
        [Shuichi Kitaguchi <ki@hh.iij4u.or.jp>] 
  
  
  
  1.50      +0 -32     apache-2.0/src/acinclude.m4
  
  Index: acinclude.m4
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/acinclude.m4,v
  retrieving revision 1.49
  retrieving revision 1.50
  diff -u -r1.49 -r1.50
  --- acinclude.m4	2000/10/07 18:16:41	1.49
  +++ acinclude.m4	2000/11/11 06:05:57	1.50
  @@ -176,38 +176,6 @@
   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([
  
  
  
  1.85      +0 -2      apache-2.0/src/configure.in
  
  Index: configure.in
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/configure.in,v
  retrieving revision 1.84
  retrieving revision 1.85
  diff -u -r1.84 -r1.85
  --- configure.in	2000/11/02 18:51:02	1.84
  +++ configure.in	2000/11/11 06:05:57	1.85
  @@ -102,8 +102,6 @@
   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],
  
  
  
  1.30      +34 -0     apache-2.0/src/lib/apr/aclocal.m4
  
  Index: aclocal.m4
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/aclocal.m4,v
  retrieving revision 1.29
  retrieving revision 1.30
  diff -u -r1.29 -r1.30
  --- aclocal.m4	2000/11/06 14:18:58	1.29
  +++ aclocal.m4	2000/11/11 06:05:58	1.30
  @@ -397,5 +397,39 @@
   fi
   ])
   
  +dnl
  +dnl APR_INADDR_NONE
  +dnl
  +dnl checks for missing INADDR_NONE macro
  +dnl
  +AC_DEFUN(APR_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
  +    apr_inaddr_none="((unsigned int) 0xffffffff)"
  +  else
  +    apr_inaddr_none="INADDR_NONE"
  +  fi
  +])
  +
   sinclude(apr_common.m4)
   sinclude(hints.m4)
  
  
  
  1.170     +3 -0      apache-2.0/src/lib/apr/configure.in
  
  Index: configure.in
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/configure.in,v
  retrieving revision 1.169
  retrieving revision 1.170
  diff -u -r1.169 -r1.170
  --- configure.in	2000/11/11 00:09:46	1.169
  +++ configure.in	2000/11/11 06:05:58	1.170
  @@ -222,6 +222,7 @@
   AC_CHECK_FUNCS(getpass)
   APR_CHECK_INET_ADDR
   APR_CHECK_INET_NETWORK
  +AC_SUBST(apr_inaddr_none)
   AC_CHECK_FUNC(_getch)
   AC_CHECK_FUNCS(gmtime_r localtime_r)
   AC_CHECK_FUNCS(iconv, [ iconv="1" ], [ iconv="0" ])
  @@ -330,6 +331,8 @@
   AC_FUNC_SETPGRP
   
   APR_CHECK_SOCKLEN_T
  +
  +APR_INADDR_NONE
   
   dnl # Checks for integer size
   AC_CHECK_SIZEOF(char, 1)
  
  
  
  1.50      +5 -0      apache-2.0/src/lib/apr/include/apr.h.in
  
  Index: apr.h.in
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/include/apr.h.in,v
  retrieving revision 1.49
  retrieving revision 1.50
  diff -u -r1.49 -r1.50
  --- apr.h.in	2000/11/08 11:53:28	1.49
  +++ apr.h.in	2000/11/11 06:05:59	1.50
  @@ -107,6 +107,11 @@
    */
   #define APR_FILES_AS_SOCKETS      @file_as_socket@
   
  +/* Not all platforms have a real INADDR_NONE.  This macro replaces INADDR_NONE
  + * on all platforms.
  + */
  +#define APR_INADDR_NONE           @apr_inaddr_none@
  +
   /* Typedefs that APR needs. */
   
   typedef  @short_value@           apr_int16_t;
  
  
  
  1.4       +3 -1      apache-2.0/src/lib/apr/network_io/unix/sa_common.c
  
  Index: sa_common.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/network_io/unix/sa_common.c,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- sa_common.c	2000/11/10 16:11:13	1.3
  +++ sa_common.c	2000/11/11 06:05:59	1.4
  @@ -63,6 +63,8 @@
    * that differs between platforms.
    */
   
  +#include "apr.h"
  +
   apr_status_t apr_set_port(apr_socket_t *sock, apr_interface_e which, 
                            apr_port_t port)
   {
  @@ -122,7 +124,7 @@
           addr->s_addr = htonl(INADDR_ANY);
           return APR_SUCCESS;
       }
  -    if ((addr->s_addr = apr_inet_addr(hostname)) != INADDR_NONE)
  +    if ((addr->s_addr = apr_inet_addr(hostname)) != APR_INADDR_NONE)
           return APR_SUCCESS;
   
       /* hmmm, it's not a numeric IP address so we need to look it up :( */
  
  
  
  1.18      +1 -1      apache-2.0/src/lib/apr/network_io/win32/sockaddr.c
  
  Index: sockaddr.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/network_io/win32/sockaddr.c,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- sockaddr.c	2000/11/09 17:59:16	1.17
  +++ sockaddr.c	2000/11/11 06:05:59	1.18
  @@ -94,7 +94,7 @@
       
       ipaddr = inet_addr(addr);
       
  -    if (ipaddr == INADDR_NONE) {
  +    if (ipaddr == APR_INADDR_NONE) {
           return WSAEADDRNOTAVAIL;
       }
       
  
  
  
  1.80      +1 -1      apache-2.0/src/main/util.c
  
  Index: util.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/main/util.c,v
  retrieving revision 1.79
  retrieving revision 1.80
  diff -u -r1.79 -r1.80
  --- util.c	2000/11/10 15:28:56	1.79
  +++ util.c	2000/11/11 06:05:59	1.80
  @@ -1868,7 +1868,7 @@
       }
   
       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;
  
  
  
  1.21      +1 -1      apache-2.0/src/modules/proxy/proxy_util.c
  
  Index: proxy_util.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/modules/proxy/proxy_util.c,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- proxy_util.c	2000/10/08 06:05:22	1.20
  +++ proxy_util.c	2000/11/11 06:06:00	1.21
  @@ -885,7 +885,7 @@
               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",
  
  
  
  1.21      +3 -3      apache-2.0/src/modules/standard/mod_access.c
  
  Index: mod_access.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/modules/standard/mod_access.c,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- mod_access.c	2000/10/16 06:05:03	1.20
  +++ mod_access.c	2000/11/11 06:06:00	1.21
  @@ -193,7 +193,7 @@
   	*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 @@
   	/* 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 @@
   	    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;
  
  
  

Mime
View raw message