diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2013-08-07 02:30:23 +0200 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2013-08-07 02:30:23 +0200 |
commit | 5ca89b31210b249f79a1a5cd1a258c85fdb7970e (patch) | |
tree | e08c894ab12d68c215713317d841ac6de552e619 /src/send.c | |
parent | ae90406453eb894400a25e0557bb2c7bf19f06a4 (diff) | |
download | fastd-5ca89b31210b249f79a1a5cd1a258c85fdb7970e.tar fastd-5ca89b31210b249f79a1a5cd1a258c85fdb7970e.zip |
Guard socket options not available on FreeBSD
Diffstat (limited to 'src/send.c')
-rw-r--r-- | src/send.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -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)); |