The following reply was made to PR os-osf/463; it has been noted by GNATS.
From: Dean Gaudet <[EMAIL PROTECTED]>
To: Brett McCormick <[EMAIL PROTECTED]>
Subject: Re: os-osf/463: virtualhost support functionally broken
Date: Wed, 23 Apr 1997 14:50:43 -0700 (PDT)
On Wed, 23 Apr 1997, Brett McCormick wrote:
> I'll try changing it to use inet_network, but again, these functions
> take string ip addresses, whereas I'm using hostnames..
Yep but they're called to find out if the address passed is an ip addr,
and if we're misinterpreting their result code it would cause the problem
you describe. All vhosts would be treated as if they were _default_ and
the code would actually end up using the first one in the file.
Your inet_addr returns (in_addr_t)-1, which isn't what we test for -- we
test for INADDR_NONE. Unfortunately every other arch returns INADDR_NONE
as the error code. Using inet_network might fix that. If it doesn't you
could give the patch below a try. (A similar change needs to be applied
to get_virthost_addr() in util.c.)
Dean
*** http_config.c.dist Wed Apr 23 14:47:13 1997
--- http_config.c Wed Apr 23 14:48:22 1997
***************
*** 879,891 ****
|| strcmp(w, "255.255.255.255") == 0 ) {
my_addr = DEFAULT_VHOST_ADDR;
is_an_ip_addr = 1;
! } else if(
! #ifdef DGUX
! ( my_addr = inet_network(w) )
#else
! ( my_addr = inet_addr(w) )
#endif
! != INADDR_NONE ) {
is_an_ip_addr = 1;
}
if( is_an_ip_addr ) {
--- 879,893 ----
|| strcmp(w, "255.255.255.255") == 0 ) {
my_addr = DEFAULT_VHOST_ADDR;
is_an_ip_addr = 1;
! }
! #if defined( DGUX )
! else if( ( my_addr = inet_network(w) ) != INADDR_NONE )
! #elif defined( OSF1 )
! else if( ( my_addr = inet_addr(w) ) != (in_addr_t)-1 )
#else
! else if( ( my_addr = inet_addr(w) ) != INADDR_NONE )
#endif
! {
is_an_ip_addr = 1;
}
if( is_an_ip_addr ) {