summaryrefslogtreecommitdiffstats
path: root/src/send.c
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2013-08-07 02:30:23 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2013-08-07 02:30:23 +0200
commit5ca89b31210b249f79a1a5cd1a258c85fdb7970e (patch)
treee08c894ab12d68c215713317d841ac6de552e619 /src/send.c
parentae90406453eb894400a25e0557bb2c7bf19f06a4 (diff)
downloadfastd-5ca89b31210b249f79a1a5cd1a258c85fdb7970e.tar
fastd-5ca89b31210b249f79a1a5cd1a258c85fdb7970e.zip
Guard socket options not available on FreeBSD
Diffstat (limited to 'src/send.c')
-rw-r--r--src/send.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/send.c b/src/send.c
index 4e0d77a..2868d4d 100644
--- a/src/send.c
+++ b/src/send.c
@@ -35,6 +35,7 @@ static inline void add_pktinfo(struct msghdr *msg, const fastd_peer_address_t *l
struct cmsghdr *cmsg = (struct cmsghdr*)((char*)msg->msg_control + msg->msg_controllen);
+#ifdef USE_PKTINFO
if (local_addr->sa.sa_family == AF_INET) {
cmsg->cmsg_level = IPPROTO_IP;
cmsg->cmsg_type = IP_PKTINFO;
@@ -44,8 +45,11 @@ static inline void add_pktinfo(struct msghdr *msg, const fastd_peer_address_t *l
struct in_pktinfo *pktinfo = (struct in_pktinfo*)CMSG_DATA(cmsg);
pktinfo->ipi_addr = local_addr->in.sin_addr;
+ return;
}
- else if (local_addr->sa.sa_family == AF_INET6) {
+#endif
+
+ if (local_addr->sa.sa_family == AF_INET6) {
cmsg->cmsg_level = IPPROTO_IPV6;
cmsg->cmsg_type = IPV6_PKTINFO;
cmsg->cmsg_len = CMSG_LEN(sizeof(struct in6_pktinfo));