apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Trawick <traw...@attglobal.net>
Subject Re: apr_sockaddr_info_get: Posible bug
Date Wed, 20 Nov 2002 13:30:55 GMT
"Dagfinn Aarvaag" <dagfinn.aarvaag@beepscience.com> writes:

> Hi,
> 
> I see the same problem on Solaris 8 and Win32.
> apr_sockaddr_info_get return apr code APR_SUCCESS,
> but returned IP address and hostname in the struct apr_sockaddr_t are
> "0.0.0.0" and "".

not the same problem...  he got APR_EINVAL because his newer APR
realized he was passing flags that didn't make sense because of other
parameters

in your case it seems bad that hostname field is not set...  seems
like hostname should be set to "0.0.0.0"

did you have to change his call to pass 0 instead of APR_IPV4_ADDR_OK
since your APR didn't have that constant, or am I confused?

When I make with this call using current APR:

  Breakpoint 1, apr_sockaddr_info_get (sa=0xbffff7a0, 
    hostname=0x804938f "0.0.0.0", family=2, port=20000, flags=0, 
    p=0x804e930) at sockaddr.c:552

I get this apr_sockaddr_t built:

$3 = {pool = 0x804e930, hostname = 0x804e9b0 "0.0.0.0", servname = 0x0, 
  port = 20000, family = 2, sa = {sin = {sin_family = 2,
  sin_port = 8270, sin_addr = {s_addr = 0}, sin_zero =  "\0\0\0\0\0\0\0"}, 
  sin6 = {sin6_family = 2, sin6_port = 8270, sin6_flowinfo = 0, 
  sin6_addr = {in6_u = {u6_addr8 = '\0' <repeats 15 times>, 
  u6_addr16 = {0, 0, 0, 0, 0, 0, 0, 0}, u6_addr32 = {0, 0, 0, 0}}}, 
  sin6_scope_id = 0}}, salen = 16, ipaddr_len = 4, addr_str_len = 16,
  ipaddr_ptr = 0x804e980, next = 0x0}

If you're getting hostname set to "", that definitely sounds like a
bug.

-- 
Jeff Trawick | trawick@attglobal.net
Born in Roswell... married an alien...

Mime
View raw message