apr-bugs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 46964] New: apr_sockaddr_vars_set() Needs to always set the port
Date Fri, 03 Apr 2009 17:35:18 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=46964

           Summary: apr_sockaddr_vars_set() Needs to always set the port
           Product: APR
           Version: 1.2.12
          Platform: PC
        OS/Version: AIX
            Status: NEW
          Severity: normal
          Priority: P2
         Component: APR
        AssignedTo: bugs@apr.apache.org
        ReportedBy: Joe.Mudd@sas.com


When running on AIX, calling:

apr_sockaddr_info_get(&sa, "localhost", APR_UNSPEC, 0, APR_IPV6_ADDR_OK, pool);

when the library was built w/IPv6 ok but the host only has IPV4 sometimes
results in a sockaddr that has a non-zero port.  In my case, 1.  Which causes
the subsequent apr_socket_bind() to fail w/EACCES.

apr_sockaddr_info_get(), via call_resolver(), calls getaddrinfo() with a host
name and a NULL service name.  When successful, the copied addrinfo->ai_addr
sometimes has a 1 in sin_port.

Since the man page for getaddrinfo() doesn't seem to explicitly state what the
returned value for the port will be when service name is NULL, perhaps the
prudent thing for apr_sockaddr_vars_set() to do would be to always set the
port... even when the port is zero.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org


Mime
View raw message