summaryrefslogtreecommitdiffstats
path: root/transport
diff options
context:
space:
mode:
Diffstat (limited to 'transport')
-rw-r--r--transport/ib-verbs/src/Makefile.am2
-rw-r--r--transport/ib-verbs/src/name.c26
2 files changed, 22 insertions, 6 deletions
diff --git a/transport/ib-verbs/src/Makefile.am b/transport/ib-verbs/src/Makefile.am
index e6240090e92..83b610b9cf9 100644
--- a/transport/ib-verbs/src/Makefile.am
+++ b/transport/ib-verbs/src/Makefile.am
@@ -10,6 +10,6 @@ ib_verbs_la_LIBADD = -libverbs $(top_builddir)/libglusterfs/src/libglusterfs.la
AM_CFLAGS = -fPIC -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -Wall -D$(GF_HOST_OS)\
-I$(top_srcdir)/libglusterfs/src -I$(top_srcdir)/transport/ib-verbs \
- -shared -nostartfiles
+ -shared -nostartfiles $(GF_CFLAGS)
CLEANFILES = *~
diff --git a/transport/ib-verbs/src/name.c b/transport/ib-verbs/src/name.c
index 2e29009391b..31ce5291d70 100644
--- a/transport/ib-verbs/src/name.c
+++ b/transport/ib-verbs/src/name.c
@@ -574,11 +574,27 @@ fill_inet6_inet_identifiers (transport_t *this, struct sockaddr_storage *addr,
one_to_four = four_to_eight = twelve_to_sixteen = 0;
eight_to_ten = ten_to_twelve = 0;
- one_to_four = ((struct sockaddr_in6 *) &tmpaddr)->sin6_addr.s6_addr32[0];
- four_to_eight = ((struct sockaddr_in6 *) &tmpaddr)->sin6_addr.s6_addr32[1];
- eight_to_ten = ((struct sockaddr_in6 *) &tmpaddr)->sin6_addr.s6_addr16[4];
- ten_to_twelve = ((struct sockaddr_in6 *) &tmpaddr)->sin6_addr.s6_addr16[5];
- twelve_to_sixteen = ((struct sockaddr_in6 *) &tmpaddr)->sin6_addr.s6_addr32[3];
+ one_to_four = ((struct sockaddr_in6 *)
+ &tmpaddr)->sin6_addr.s6_addr32[0];
+ four_to_eight = ((struct sockaddr_in6 *)
+ &tmpaddr)->sin6_addr.s6_addr32[1];
+#ifdef GF_SOLARIS_HOST_OS
+ eight_to_ten = S6_ADDR16(((struct sockaddr_in6 *)
+ &tmpaddr)->sin6_addr)[4];
+#else
+ eight_to_ten = ((struct sockaddr_in6 *)
+ &tmpaddr)->sin6_addr.s6_addr16[4];
+#endif
+
+#ifdef GF_SOLARIS_HOST_OS
+ ten_to_twelve = S6_ADDR16(((struct sockaddr_in6 *)
+ &tmpaddr)->sin6_addr)[5];
+#else
+ ten_to_twelve = ((struct sockaddr_in6 *)
+ &tmpaddr)->sin6_addr.s6_addr16[5];
+#endif
+ twelve_to_sixteen = ((struct sockaddr_in6 *)
+ &tmpaddr)->sin6_addr.s6_addr32[3];
/* ipv4 mapped ipv6 address has
bits 0-80: 0