Skip to content

[BZ-4202] ACE_Pipe open can get IPv4, IPv6 confused #4202

@jwillemsen

Description

@jwillemsen
Field Value
Bugzilla ID 4202
Reporter @shuston
Assigned to @shuston
Product ACE
Component ACE Core
Version 6.3.2
Platform / OS x86 / Windows NT
Priority P3
Severity normal
Status ASSIGNED
Resolution
Created 2015-05-22 15:10:32 -0500

Originally posted by @shuston on 2015-05-22 15:10:32 -0500


Sent in by a customer:
It looks like we may have run across an ACE bug that we want to bounce off of you. For reference, we’re using IPv6 in our VxWorks code, so we have ACE_HAS_IPV6 defined in our config.h file. Also, for VxWorks, “localhost" is defined only as an IPv4 address (no IPv6 definition) and “localhost6" defines the IPv6 version. And finally, ACE_LOCALHOST is defined as “localhost”.

When ACE opens a pipe (VxWorks also has ACE_LACKS_SOCKETPAIR defined), it creates an ACE_INET_Addr and uses ACE_LOCALHOST (IPv4) without an address family specification (highlighted below). When there is no address family specification passed in and IPv6 is enabled, the ACE_INET_Addr constructor defaults to AF_UNSPECIFIED, which eventually gets turned into AF_INET6. So, we end up with an IPv4 host name and an IPv6 address family specification. It looks like maybe this behavior was added as a result of this link: https://groups.google.com/forum/#!msg/comp.soft-sys.ace/6Pbu91oXVWQ/HTKwDnzH_QQJ.

See what you think and how you think it should be handled.

int
ACE_Pipe::open (int buffer_size)
{
ACE_TRACE ("ACE_Pipe::open");

#if defined (ACE_LACKS_SOCKETPAIR)
ACE_INET_Addr my_addr;
ACE_SOCK_Acceptor acceptor;
ACE_SOCK_Connector connector;
ACE_SOCK_Stream reader;
ACE_SOCK_Stream writer;
int result = 0;

if defined (ACE_WIN32)

ACE_INET_Addr local_any (static_cast<u_short> (0), ACE_LOCALHOST);

else

ACE_Addr local_any = ACE_Addr::sap_any;

endif /* ACE_WIN32 */

// Bind listener to any port and then find out what the port was.
if (acceptor.open (local_any) == -1
|| acceptor.get_local_addr (my_addr) == -1)
result = -1;
else
{
ACE_INET_Addr sv_addr (my_addr.get_port_number (),
ACE_LOCALHOST);

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions