totemip uses a GNU glibc-ism (s16_addr in the in6_addr struct) which is
not available on non-GLIBC systems (solaris specifically).
This patch changes the compare to compare 8 bits at a time instead of
16.
Chrissie, is there a reason the compare was being done 16 bits at a
time? If so, we will have to cache two 8 bit values into a 16 bit value
for each and then do the comparison to be portable.
Also 32 bit access is not portable.
Regards
-steve
Index: exec/totemip.c
===================================================================
--- exec/totemip.c (revision 2207)
+++ exec/totemip.c (working copy)
@@ -60,16 +60,10 @@
#if defined(COROSYNC_LINUX)
#include <net/if.h>
-
-/* ARGH!! I hate netlink */
#include <asm/types.h>
#include <linux/rtnetlink.h>
#endif
-#ifndef s6_addr16
-#define s6_addr16 __u6_addr.__u6_addr16
-#endif
-
#include <corosync/totem/totemip.h>
#include <corosync/swab.h>
@@ -156,13 +150,13 @@
} else
if (family == AF_INET6) {
/*
- * Compare 16 bits at a time the ipv6 address
+ * We can only compare 8 bits at time for portability reasons
*/
memcpy (&ipv6_a1, totemip_a->addr, sizeof (struct in6_addr));
memcpy (&ipv6_a2, totemip_b->addr, sizeof (struct in6_addr));
- for (i = 0; i < 8; i++) {
- int res = htons(ipv6_a1.s6_addr16[i]) -
- htons(ipv6_a2.s6_addr16[i]);
+ for (i = 0; i < 16; i++) {
+ int res = ipv6_a1.s6_addr[i] -
+ ipv6_a2.s6_addr[i];
if (res) {
return res;
}
_______________________________________________
Openais mailing list
[email protected]
https://lists.linux-foundation.org/mailman/listinfo/openais