DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=25779>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=25779

Numeric IP address in ProxyPass directive

           Summary: Numeric IP address in ProxyPass directive
           Product: Apache httpd-1.3
           Version: 1.3.29
          Platform: Sun
        OS/Version: Other
            Status: NEW
          Severity: Minor
          Priority: Other
         Component: mod_proxy
        AssignedTo: [email protected]
        ReportedBy: [EMAIL PROTECTED]


I ran into this under OpenBSD 3.4 on a Sun Ultra I; however, it appears to
affect other configurations including x86.

The code within `mod_proxy' that parses numeric IP addresses is nonportable; by
my reading, it works only on 32-bit, big-endian systems.  It definitely doesn't
work on the 64-bit big-endian system I am using.  Here is a patch that fixes the
problem for me:

<pre>
*** mod_proxy.h.orig    2003-08-21 06:11:36.000000000 -0700
--- mod_proxy.h 2003-12-27 20:30:29.000000000 -0800
***************
*** 256,262 ****
  
  struct per_thread_data {
      struct hostent hpbuf;
!     u_long ipaddr;
      char *charpbuf[2];
  };
  /* Function prototypes */
--- 256,262 ----
  
  struct per_thread_data {
      struct hostent hpbuf;
!     struct in_addr ipaddr;
      char *charpbuf[2];
  };
  /* Function prototypes */
*** proxy_util.c.orig   2003-08-21 06:11:36.000000000 -0700
--- proxy_util.c        2003-12-27 20:30:30.000000000 -0800
***************
*** 999,1005 ****
              return "Host not found";
      }
      else {
!         ptd->ipaddr = ap_inet_addr(host);
          hp = gethostbyaddr((char *)&ptd->ipaddr, sizeof(ptd->ipaddr), 
AF_INET);
          if (hp == NULL) {
              memset(&ptd->hpbuf, 0, sizeof(ptd->hpbuf));
--- 999,1005 ----
              return "Host not found";
      }
      else {
!       if (inet_aton(host, &ptd->ipaddr) == 0) return "Invalid numeric 
address";
          hp = gethostbyaddr((char *)&ptd->ipaddr, sizeof(ptd->ipaddr), 
AF_INET);
          if (hp == NULL) {
              memset(&ptd->hpbuf, 0, sizeof(ptd->hpbuf));
</pre>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to