apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dagfinn Aarvaag" <dagfinn.aarv...@beepscience.com>
Subject RE: apr_sockaddr_info_get: Posible bug
Date Wed, 20 Nov 2002 14:14:13 GMT

Hi,

I am using an old version of APR and was not able to set the flag
APR_IPV4_ADDR_OK
Should upgrade !! but is waiting for your next (pre)release.

I tried different possbilities calling  apr_sockaddr_info_get
as shown below

   // Given address is an externally valid IP address
   else {
      apr = apr_sockaddr_info_get(&myAddr,addr,APR_INET,port,0,memPool);
      if (apr != APR_SUCCESS) {
...
   }

// When address is 127.0.0.1 or localhost

      apr =
apr_sockaddr_info_get(&myAddr,APR_ANYADDR,APR_INET,port,0,memPool);
      if (apr != APR_SUCCESS) {
....
   }

In addition I tried calling:

      apr = apr_sockaddr_info_get(&myAddr,addr,APR_INET,port,0,memPool);

setting the addr to 127.0.0.1. APR returns 127.0.0.1 hostname ""or 0.0.0.0
hostname "" depending on how it is called. I am not able get the APR to
return the real IP address/hostname

Regards Dagfinn

-----Original Message-----
From: trawick@rdu74-177-063.nc.rr.com
[mailto:trawick@rdu74-177-063.nc.rr.com]On Behalf Of Jeff Trawick
Sent: 20 November 2002 14:31
To: Dagfinn Aarvaag
Cc: Damir Dezeljin; APR
Subject: Re: apr_sockaddr_info_get: Posible bug


"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