From aa0fd06dad70a7ecfc3dab819e9b3fab8baad2a9 Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Thu, 2 Apr 2009 02:49:42 -0700 Subject: Build fixes for ib-verbs compilation on solaris Build fixes for solaris on ib-verbs with recent OFUV Update 3 release. Signed-off-by: Anand V. Avati --- transport/ib-verbs/src/Makefile.am | 2 +- transport/ib-verbs/src/name.c | 26 +++++++++++++++++++++----- 2 files changed, 22 insertions(+), 6 deletions(-) (limited to 'transport') diff --git a/transport/ib-verbs/src/Makefile.am b/transport/ib-verbs/src/Makefile.am index e6240090e..83b610b9c 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 2e2900939..31ce5291d 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 -- cgit