httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From (Dean Gaudet)
Subject Re: WWW Form Bug Report: "osf/1 virtualhost support by ip broken" on OSF/1
Date Tue, 12 Nov 1996 06:41:09 GMT
In article <>,
Roy T. Fielding <> wrote:
>Could someone with virtual hosts please test this change and commit it?

Well, under bsdi, irix, and linux you can use INADDR_NONE.  Under solaris
the man page even says the functions (inet_addr, inet_network) return -1
on error (despite returning unsigned long).  Casting -1 to an unsigned
long should work on any compiler pretending to be ansi, as should using
the constant ~0ul.

On the other hand, the newer inet_aton avoids this problem by not
overloading the return value.


>Two people have reported the same fix, and it seems obvious that the
>existing code is silly, but I don't like committing what I can't test
>at all.  The only real question is whether other compilers will complain
>about casting a negative number to an unsigned long.
>>>Operating system: OSF/1, version: 
>>>Version of Apache Used: 1.1.1
>>>Extra Modules used: 
>>>URL exhibiting problem: 
>>>Access to virtual hosts by ip returns main server
>>>page, unless the Host header is given.
>>>The problem is in util.c, in the function
>>>get_virthost_addr, on line 1019:
>>>    if (my_addr != ((unsigned long) 0xffffffff))
>>>I changed 0xffffffff to -1, and it works.  

View raw message