diff options
author | Steve Huston <shuston@riverace.com> | 2012-03-24 22:01:30 +0000 |
---|---|---|
committer | Steve Huston <shuston@riverace.com> | 2012-03-24 22:01:30 +0000 |
commit | 4a032cf69632c1ad7bccf27db3a44d1b5cad48f0 (patch) | |
tree | 348d85d8de771636c10e4e4d94fea4d793793688 | |
parent | f23330c58af5a10749b897449a54050ce1e120b1 (diff) | |
download | ATCD-4a032cf69632c1ad7bccf27db3a44d1b5cad48f0.tar.gz |
ChangeLogTag:Sat Mar 24 21:53:13 UTC 2012 Steve Huston <shuston@riverace.com>
-rw-r--r-- | ACE/ChangeLog | 11 | ||||
-rw-r--r-- | ACE/ace/SOCK_Dgram_Mcast.cpp | 28 | ||||
-rw-r--r-- | ACE/bin/MakeProjectCreator/config/acedefaults.mpb | 4 | ||||
-rw-r--r-- | ACE/bin/MakeProjectCreator/config/ipv6.mpb | 4 |
4 files changed, 37 insertions, 10 deletions
diff --git a/ACE/ChangeLog b/ACE/ChangeLog index 1764d66d8d0..016424da10c 100644 --- a/ACE/ChangeLog +++ b/ACE/ChangeLog @@ -1,3 +1,14 @@ +Sat Mar 24 21:53:13 UTC 2012 Steve Huston <shuston@riverace.com> + + * ace/SOCK_Dgram_Mcast.cpp (subscribe_ifs): For Windows, handle IPv6 + and IPv4 differently. The make_multicast_ifaddr() call that will end + up being made for IPv4 wants the interface's IP address, not name. + + * bin/MakeProjectCreator/config/acedefaults.mpb: + * bin/MakeProjectCreator/config/ipv6.mpb: Moved the lit_lib for iphlpapi + on Windows from the IPv6 base to acedefaults. SOCK_Dgram_Mcast.cpp + uses it for both IPv4 and IPv6 now. + Fri Mar 23 22:06:11 UTC 2012 Steve Huston <shuston@riverace.com> * ace/WIN32_Asynch_IO.cpp: Fixed possible heap corruption in diff --git a/ACE/ace/SOCK_Dgram_Mcast.cpp b/ACE/ace/SOCK_Dgram_Mcast.cpp index e1d4737205e..9e968a47663 100644 --- a/ACE/ace/SOCK_Dgram_Mcast.cpp +++ b/ACE/ace/SOCK_Dgram_Mcast.cpp @@ -351,13 +351,29 @@ ACE_SOCK_Dgram_Mcast::subscribe_ifs (const ACE_INET_Addr &mcast_addr, return -1; } - while (pAddrs) + for (; pAddrs; pAddrs = pAddrs->Next) { - if (this->join (mcast_addr, reuse_addr, - ACE_TEXT_CHAR_TO_TCHAR(pAddrs->AdapterName)) == 0) - ++nr_subscribed; + if (pAddrs->OperStatus != IfOperStatusUp) + continue; - pAddrs = pAddrs->Next; + // The ACE_SOCK_Dgram::make_multicast_ifaddr (IPv4), called by join(), + // can only deal with a dotted-decimal address, not an interface name. + if (family == AF_INET) + { + ACE_INET_Addr intf_addr ((sockaddr_in*)(pAddrs->FirstUnicastAddress->Address.lpSockaddr), + pAddrs->FirstUnicastAddress->Address.iSockaddrLength); + char intf_addr_str[INET_ADDRSTRLEN]; + intf_addr.get_host_addr (intf_addr_str, sizeof (intf_addr_str)); + if (this->join (mcast_addr, reuse_addr, + ACE_TEXT_CHAR_TO_TCHAR(intf_addr_str)) == 0) + ++nr_subscribed; + } + else + { + if (this->join (mcast_addr, reuse_addr, + ACE_TEXT_CHAR_TO_TCHAR(pAddrs->AdapterName)) == 0) + ++nr_subscribed; + } } delete[] buf; // clean up @@ -389,7 +405,7 @@ ACE_SOCK_Dgram_Mcast::subscribe_ifs (const ACE_INET_Addr &mcast_addr, --if_cnt; // Convert to 0-based for indexing, next loop check. - if (if_addrs[if_cnt].get_type () != AF_INET || if_addrs[if_cnt].is_loopback ()) + if (if_addrs[if_cnt].get_type () != family || if_addrs[if_cnt].is_loopback ()) continue; char addr_buf[INET6_ADDRSTRLEN]; if (this->join (mcast_addr, diff --git a/ACE/bin/MakeProjectCreator/config/acedefaults.mpb b/ACE/bin/MakeProjectCreator/config/acedefaults.mpb index 7c7cff5c75c..6798ba1ea52 100644 --- a/ACE/bin/MakeProjectCreator/config/acedefaults.mpb +++ b/ACE/bin/MakeProjectCreator/config/acedefaults.mpb @@ -17,6 +17,10 @@ project: ipv6, vc_warnings, build_files, test_files, svc_conf_files, ace_unicode macro_for_lib_modifier=1 } + specific(prop:windows) { + lit_libs += iphlpapi + } + specific(cdt6) { win32::platform_libs += ws2_32 mswsock netapi32 release::macros += ACE_NDEBUG ACE_USE_RCSID=0 diff --git a/ACE/bin/MakeProjectCreator/config/ipv6.mpb b/ACE/bin/MakeProjectCreator/config/ipv6.mpb index 92473ad7113..b76821b80d1 100644 --- a/ACE/bin/MakeProjectCreator/config/ipv6.mpb +++ b/ACE/bin/MakeProjectCreator/config/ipv6.mpb @@ -2,9 +2,5 @@ // $Id$ feature(ipv6) { - specific(prop:windows) { - lit_libs += iphlpapi - } - macros += ACE_HAS_IPV6 } |