summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/ipcpd/shim-eth-llc/main.c1
-rw-r--r--src/lib/byte_order.h8
-rw-r--r--src/tools/cbr/cbr.c1
3 files changed, 7 insertions, 3 deletions
diff --git a/src/ipcpd/shim-eth-llc/main.c b/src/ipcpd/shim-eth-llc/main.c
index 15482f87..f96c6e8a 100644
--- a/src/ipcpd/shim-eth-llc/main.c
+++ b/src/ipcpd/shim-eth-llc/main.c
@@ -773,7 +773,6 @@ static int eth_llc_ipcp_bootstrap(struct dif_config * conf)
memcpy(LLADDR(&device), ifr.ifr_addr.sa_data, MAC_SIZE);
device.sdl_alen = MAC_SIZE;
/* TODO: replace socket calls with bpf for BSD */
- LOG_MISSING;
skfd = socket(AF_LINK, SOCK_RAW, 0);
#else
device.sll_ifindex = idx;
diff --git a/src/lib/byte_order.h b/src/lib/byte_order.h
index 9ee082af..364b06cc 100644
--- a/src/lib/byte_order.h
+++ b/src/lib/byte_order.h
@@ -49,7 +49,9 @@
#include <stdlib.h>
#ifdef __GLIBC__
-# include <endian.h>
+#include <endian.h>
+#elif defined(__FreeBSD__)
+#include <sys/endian.h>
#endif
/* if x86 compatible cpu */
@@ -131,7 +133,8 @@ static inline uint32_t bswap_32(uint32_t x) {
#if defined(__GNUC__) && (__GNUC__ >= 4) && \
(__GNUC__ > 4 || __GNUC_MINOR__ >= 3)
#define bswap_64(x) __builtin_bswap64(x)
-#elif !defined(__STRICT_ANSI__)
+#elif !defined (bswap64)
+#if !defined(__STRICT_ANSI__)
static inline uint64_t bswap_64(uint64_t x) {
union {
uint64_t ll;
@@ -145,6 +148,7 @@ static inline uint64_t bswap_64(uint64_t x) {
#else
#error "bswap_64 unsupported"
#endif
+#endif
#ifdef CPU_BIG_ENDIAN
#define be2me_32(x) (x)
diff --git a/src/tools/cbr/cbr.c b/src/tools/cbr/cbr.c
index 752395da..ef8a58ba 100644
--- a/src/tools/cbr/cbr.c
+++ b/src/tools/cbr/cbr.c
@@ -21,6 +21,7 @@
*/
#define _POSIX_C_SOURCE 199506L
+#define __XSI_VISIBLE 500
#include <stdio.h>
#include <string.h>