summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoah Watkins <noahwatkins@gmail.com>2013-07-21 17:08:08 -0700
committerNoah Watkins <noahwatkins@gmail.com>2013-09-17 10:41:18 -0700
commita67404e96a8aa959b34ffe0879a1a8267c12b475 (patch)
treeea5c5c28cd40d06c52b10d201713702d690d19d7
parent4fcf4b14a73a4ca517c4e27a1014d36bdad52992 (diff)
downloadceph-a67404e96a8aa959b34ffe0879a1a8267c12b475.tar.gz
networking: assorted networking fixes
Unsure about how to properly do networking portable. Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
-rw-r--r--src/common/ipaddr.cc10
-rw-r--r--src/msg/msg_types.h8
2 files changed, 14 insertions, 4 deletions
diff --git a/src/common/ipaddr.cc b/src/common/ipaddr.cc
index 253a7c67de7..55a13f392e2 100644
--- a/src/common/ipaddr.cc
+++ b/src/common/ipaddr.cc
@@ -4,6 +4,16 @@
#include <stdlib.h>
#include <string.h>
+#include "acconfig.h"
+
+#ifdef DARWIN
+#ifndef s6_addr16
+#define s6_addr16 __u6_addr.__u6_addr16
+#endif
+#ifndef s6_addr32
+#define s6_addr32 __u6_addr.__u6_addr32
+#endif
+#endif
static void netmask_ipv4(const struct in_addr *addr,
unsigned int prefix_len,
diff --git a/src/msg/msg_types.h b/src/msg/msg_types.h
index 40b3f0bfedc..ce14c1a07b8 100644
--- a/src/msg/msg_types.h
+++ b/src/msg/msg_types.h
@@ -163,14 +163,14 @@ namespace __gnu_cxx {
*/
static inline void encode(const sockaddr_storage& a, bufferlist& bl) {
struct sockaddr_storage ss = a;
-#if !defined(__FreeBSD__)
+#if !defined(__APPLE__) && !defined(__FreeBSD__)
ss.ss_family = htons(ss.ss_family);
#endif
::encode_raw(ss, bl);
}
static inline void decode(sockaddr_storage& a, bufferlist::iterator& bl) {
::decode_raw(a, bl);
-#if !defined(__FreeBSD__)
+#if !defined(__APPLE__) && !defined(__FreeBSD__)
a.ss_family = ntohs(a.ss_family);
#endif
}
@@ -203,7 +203,7 @@ struct entity_addr_t {
type = o.type;
nonce = o.nonce;
addr = o.in_addr;
-#if !defined(__FreeBSD__)
+#if !defined(__APPLE__) && !defined(__FreeBSD__)
addr.ss_family = ntohs(addr.ss_family);
#endif
}
@@ -277,7 +277,7 @@ struct entity_addr_t {
a.type = 0;
a.nonce = nonce;
a.in_addr = addr;
-#if !defined(__FreeBSD__)
+#if !defined(__APPLE__) && !defined(__FreeBSD__)
a.in_addr.ss_family = htons(addr.ss_family);
#endif
return a;