Please find below PRF. I believe subject is already as per PRF
ACE VERSION: 6.1.1
HOST MACHINE and OPERATING SYSTEM: RHEL6.2
TARGET MACHINE and OPERATING SYSTEM, if different from HOST: RHEL6.2
COMPILER NAME AND VERSION (AND PATCHLEVEL): GCC 4.4.6
THE $ACE_ROOT/ace/config.h FILE [if you use a link to a platform-specific file, simply state which one]:
#define ACE_HAS_IPV6 1
#define ACE_USES_IPV4_IPV6_MIGRATION 1
#define ACE_HAS_LIMITED_SELECT 1
#include "ace/config-linux.h"
THE $ACE_ROOT/include/makeinclude/platform_macros.GNU FILE [if you use a link to a platform-specific file, simply state which one (unless this isn't used in this case, e.g., with Microsoft Visual C++)]: NARW
CONTENTS OF $ACE_ROOT/bin/MakeProjectCreator/config/default.features (used by MPC when you generate your own makefiles): NARW
AREA/CLASS/EXAMPLE AFFECTED: ACE_INET_Addr::set (u_short port_number,
const char host_name[],
int encode,
int address_family)DOES THE PROBLEM AFFECT: EXECUTION
SYNOPSIS:
ACE default protocol has been changed to IPv6 (AFAIK 6.1.1 onwards) on IPv6 enabled kernels if ACE has IPv6 Enabled
DESCRIPTION:
In one of my application I am using "localhost" and some port with ACE_INET_Addr::set(port,host). Then at later stage the application tries to connect on the same.
My issue here is that the same application used to work fine when it was using ACE-5.5.1 but it started failing After I upgraded to ACE-6.1.1.
Issue I could find is that >=ACE-6.1.1 is treating "localhost" as an IPv6 address by default, if your kernel supports IPv6 and ACE is IPv6 enabled. However this was not the case with ACE-5.5.1.
I've compared the code of ACE_INET_Addr::set (u_short port_number, const char host_name[], int encode, int address_family) in INET_Addr.cpp for both ACE-5.5.1 and ACE-6.1.1. What I could find is that in ACE-5.5.1:
if you don't specify address_family in ACE_INET_Addr::set() which would be by default AF_UNSPEC, also if ACE has IPv6 enabled then hints.ai_family will have value as AF_UNSPEC to getaddrinfo() which then detects the address as IPv4.
However in newer version >=ACE-6.1.1:
if you don't specify address_family in ACE_INET_Addr::set() which would be by default AF_UNSPEC, also if ACE has IPv6 enabled and your kernel support IPv6 then hints.ai_family will have value as AF_INET6 to getaddrinfo() hence "localhost" is treated as IPv6 ::1.
So Is there any workaround/solution/configuration to get through this new behavior, without modifying my existing code ( passing "127.0.0.1" instead of "localhost" or passing the address_family IPv4/IPv6) ?
This might save some efforts of mine replacing function calls as per the new library in all of my code base. This might help others too :)
Thanks! a lot in advance.
Nitin Padalia