summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhil Mesnier <mesnier_p@ociweb.com>2007-06-01 22:32:23 +0000
committerPhil Mesnier <mesnier_p@ociweb.com>2007-06-01 22:32:23 +0000
commitd7a42c4eadfbf6ecd4147521a29106095a90bde1 (patch)
tree9dd616c65a1fdf238b61f08ada235cb127dcb24c
parent98ba443b9b7d82ac398b692bf936cfc9f65d14b2 (diff)
downloadATCD-d7a42c4eadfbf6ecd4147521a29106095a90bde1.tar.gz
Fri Jun 1 22:26:39 UTC 2007 Phil Mesnier <mesnier_p@ociweb.com>
-rw-r--r--ACE/ChangeLog20
-rw-r--r--ACE/ace/INET_Addr.cpp25
-rw-r--r--ACE/ace/INET_Addr.h4
-rw-r--r--ACE/bin/tao_other_tests.lst1
4 files changed, 46 insertions, 4 deletions
diff --git a/ACE/ChangeLog b/ACE/ChangeLog
index ff01ce41fc2..11d9086bd92 100644
--- a/ACE/ChangeLog
+++ b/ACE/ChangeLog
@@ -1,3 +1,19 @@
+Fri Jun 1 22:26:39 UTC 2007 Phil Mesnier <mesnier_p@ociweb.com>
+
+ * ace/INET_Addr.h:
+ * ace/INET_Addr.cpp:
+
+ Added a new helper method, is_ip_equal() that compares only the
+ IP address of the object and the argument. This should be used
+ in place of comparing get_ip_address() values particularly when
+ IPv6 may be used. This new method is weaker than the equality
+ operator since that also compares port numbers. This new method
+ was motivated by a need to compare the address of a recieved
+ dgram to the interface addresses obtained via get_ip_interfaces.
+
+ * bin/tao_other_tests.lst:
+ Added IPv6 RTEC federation test to list.
+
Fri Jun 1 20:51:57 UTC 2007 ciju john <john_c@ociweb.com>
* include/makeinclude/platform_hpux_aCC.GNU:
@@ -32,10 +48,6 @@ Wed May 30 00:17:35 UTC 2007 Abdullah Sowayan <abdullah.sowayan@lmco.com>
If it doesn't, we will zap ACE_NOTREACHED from the codebase. For
details, check Bigzilla# 2948.
-Tue May 29 14:55:04 UTC 2007 Phil Mesnier <mesnier_p@ociweb.com>
-
- * bin/tao_other_tests.lst: Added IPv6 RTEC federation test to list.
-
Tue May 29 10:19:59 UTC 2007 Abdullah Sowayan <abdullah.sowayan@lmco.com>
* netsvcs/lib/Client_Logging_Handler.cpp:
diff --git a/ACE/ace/INET_Addr.cpp b/ACE/ace/INET_Addr.cpp
index c7b0f0dcbf1..33303e62511 100644
--- a/ACE/ace/INET_Addr.cpp
+++ b/ACE/ace/INET_Addr.cpp
@@ -118,6 +118,31 @@ ACE_INET_Addr::operator == (const ACE_INET_Addr &sap) const
this->get_size ()) == 0);
}
+bool
+ACE_INET_Addr::is_ip_equal (const ACE_INET_Addr &sap) const
+{
+ if (this->get_type () != sap.get_type ()
+ || this->get_size () != sap.get_size ())
+ return false;
+
+#if defined (ACE_HAS_IPV6)
+ if (this->get_type () == PF_INET6)
+ {
+ const unsigned int *addr =
+ reinterpret_cast<const unsigned int*>(this->ip_addr_pointer());
+ const unsigned int *saddr =
+ reinterpret_cast<const unsigned int*>(sap.ip_addr_pointer());
+ return (addr[0] == saddr[0] &&
+ addr[1] == saddr[1] &&
+ addr[2] == saddr[2] &&
+ addr[3] == saddr[3]);
+ }
+ else
+#endif /* ACE_HAS_IPV6 */
+ return this->get_ip_address () == sap.get_ip_address();
+}
+
+
u_long
ACE_INET_Addr::hash (void) const
{
diff --git a/ACE/ace/INET_Addr.h b/ACE/ace/INET_Addr.h
index 76672eb265c..f9cbf08a69f 100644
--- a/ACE/ace/INET_Addr.h
+++ b/ACE/ace/INET_Addr.h
@@ -344,6 +344,10 @@ public:
/// Compare two addresses for inequality.
bool operator != (const ACE_INET_Addr &SAP) const;
+ /// A variation of the equality operator, this method only compares the
+ /// IP address and ignores the port number.
+ bool is_ip_equal (const ACE_INET_Addr &SAP) const;
+
/// Computes and returns hash value.
virtual u_long hash (void) const;
diff --git a/ACE/bin/tao_other_tests.lst b/ACE/bin/tao_other_tests.lst
index 6f5ad95c750..823a77d58a3 100644
--- a/ACE/bin/tao_other_tests.lst
+++ b/ACE/bin/tao_other_tests.lst
@@ -92,6 +92,7 @@ TAO/orbsvcs/tests/EC_Custom_Marshal/run_test.pl: !ST !MINIMUM !CORBA_E_COMPACT !
TAO/orbsvcs/tests/EC_Throughput/run_test.pl: !ST !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !DISABLE_ToFix_LynxOS_x86 !ACE_FOR_TAO
TAO/orbsvcs/tests/EC_MT_Mcast/run_test.pl:!ST !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !ACE_FOR_TAO
TAO/orbsvcs/tests/Event/Mcast/RTEC_MCast_Federated/run_test.pl: !NO_MCAST !ST !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !ACE_FOR_TAO
+TAO/orbsvcs/tests/Event/Mcast/RTEC_MCast_Federated/run_test.pl -ipv6: IPV6 !NO_MCAST !ST !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !ACE_FOR_TAO
TAO/orbsvcs/tests/FaultTolerance/GroupRef_Manipulation/run_test.pl:!MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !DISABLE_INTERCEPTORS !ACE_FOR_TAO
TAO/orbsvcs/tests/FaultTolerance/IOGR/run_test.pl:!MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !DISABLE_INTERCEPTORS !ACE_FOR_TAO
TAO/orbsvcs/tests/FaultTolerance/IOGRManipulation/run_test.pl:!MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !DISABLE_INTERCEPTORS !ACE_FOR_TAO