You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bugs@apr.apache.org by bu...@apache.org on 2017/05/08 15:23:12 UTC

[Bug 61080] New: apr_sockaddr_info_get() with hostname is NULL

https://bz.apache.org/bugzilla/show_bug.cgi?id=61080

            Bug ID: 61080
           Summary: apr_sockaddr_info_get() with hostname is NULL
           Product: APR
           Version: 1.5.2
          Hardware: PC
            Status: NEW
          Severity: normal
          Priority: P2
         Component: APR
          Assignee: bugs@apr.apache.org
          Reporter: a.abfalterer@gmail.com
  Target Milestone: ---

Hi,

apr_sockaddr_info_get() does not allow to set the flag (APR_IPV4_ADDR_OK or
APR_IPV6_ADDR_OK) and to pass NULL for the hostname. In this case APR_EINVAL is
returned, see
https://github.com/apache/apr/blob/trunk/network_io/unix/sockaddr.c#L614-L618

However, the documentation says "The hostname [...] or NULL to build an address
that corresponds to 0.0.0.0 or :: [...]", see
https://apr.apache.org/docs/apr/1.6/group__apr__network__io.html#gaa2f399ca2b60b35c0abf7630298c6c9f

Also the manual of getaddrinfo says "If the AI_PASSIVE flag is specified in
hints.ai_flags, and node is NULL, then the returned socket addresses will be
suitable for bind(2)ing a socket that will accept(2) connections. The returned
socket address will contain the "wildcard address" (INADDR_ANY for IPv4
addresses, IN6ADDR_ANY_INIT for IPv6 address). The wildcard address is used by
applications (typically servers) that intend to accept connections on any of
the hosts's network addresses. If node is not NULL, then the AI_PASSIVE flag is
ignored.

If the AI_PASSIVE flag is not set in hints.ai_flags, then the returned socket
addresses will be suitable for use with connect(2), sendto(2), or sendmsg(2).
If node is NULL, then the network address will be set to the loopback interface
address (INADDR_LOOPBACK for IPv4 addresses, IN6ADDR_LOOPBACK_INIT for IPv6
address); this is used by applications that intend to communicate with peers
running on the same host."

Cheers, Armin

-- 
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


[Bug 61080] apr_sockaddr_info_get() with hostname is NULL

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=61080

Armin Abfalterer <a....@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Version|1.5.2                       |HEAD

-- 
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


[Bug 61080] apr_sockaddr_info_get() with hostname is NULL

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=61080

ivan@apache.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|NEW                         |RESOLVED

-- 
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


[Bug 61080] apr_sockaddr_info_get() with hostname is NULL

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=61080

Armin Abfalterer <a....@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 OS|                            |All
           Hardware|PC                          |All

-- 
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


[Bug 61080] apr_sockaddr_info_get() with hostname is NULL

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=61080

Armin Abfalterer <a....@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 OS|All                         |Linux

-- 
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


[Bug 61080] apr_sockaddr_info_get() with hostname is NULL

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=61080

ivan@apache.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|FIXED                       |---
     Ever confirmed|1                           |0
             Status|RESOLVED                    |UNCONFIRMED

-- 
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