build: Runtime and compilation fixes for FreeBSD 10.0
Change-Id: Idf1dfad0125c8505e60301172e205243dcd840da
Refs: #1348
diff --git a/daemon/core/network-interface.cpp b/daemon/core/network-interface.cpp
index 7319e97..ef55e7b 100644
--- a/daemon/core/network-interface.cpp
+++ b/daemon/core/network-interface.cpp
@@ -16,7 +16,7 @@
#if defined(__linux__)
#include <net/if_arp.h> // for ARPHRD_* constants
#include <netpacket/packet.h> // for struct sockaddr_ll
-#elif defined(__APPLE__)
+#elif defined(__APPLE__) || defined(__FreeBSD__)
#include <net/if_dl.h> // for struct sockaddr_dl
#else
#error Platform not supported
@@ -86,7 +86,7 @@
NFD_LOG_WARN("Unrecognized hardware address on " << ifname);
}
break;
-#elif defined(__APPLE__)
+#elif defined(__APPLE__) || defined(__FreeBSD__)
case AF_LINK: {
const sockaddr_dl* sdl = reinterpret_cast<sockaddr_dl*>(ifa->ifa_addr);
netif->index = sdl->sdl_index;
diff --git a/daemon/core/resolver.hpp b/daemon/core/resolver.hpp
index 508e26d..a02047e 100644
--- a/daemon/core/resolver.hpp
+++ b/daemon/core/resolver.hpp
@@ -99,8 +99,11 @@
{
Resolver resolver(SuccessCallback(), ErrorCallback(), addressSelector);
- typename resolver::query query(host, port,
- resolver::query::all_matching);
+ typename resolver::query query(host, port
+#if not defined(__FreeBSD__)
+ , resolver::query::all_matching
+#endif
+ );
typename resolver::iterator remoteEndpoint = resolver.m_resolver.resolve(query);
typename resolver::iterator end;
@@ -128,8 +131,11 @@
const time::seconds& timeout,
const shared_ptr<Resolver>& self)
{
- typename resolver::query query(host, port,
- resolver::query::all_matching);
+ typename resolver::query query(host, port
+#if not defined(__FreeBSD__)
+ , resolver::query::all_matching
+#endif
+ );
m_resolver.async_resolve(query,
bind(&Resolver::onResolveSuccess, this, _1, _2, self));