diff --git a/doc/Changelog b/doc/Changelog index 9024031fb..83401e3fa 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -1,3 +1,6 @@ +16 March 2016: Wouter + - Fix ip-transparent for ipv6 on FreeBSD. + 15 March 2016: Wouter - ip_freebind: yesno option in unbound.conf sets IP_FREEBIND for binding to an IP address while the interface or address is down. diff --git a/services/listen_dnsport.c b/services/listen_dnsport.c index 6b844b0c9..0aa3a3c98 100644 --- a/services/listen_dnsport.c +++ b/services/listen_dnsport.c @@ -202,9 +202,10 @@ create_udp_sock(int family, int socktype, struct sockaddr* addr, #elif defined(IP_BINDANY) if (transparent && setsockopt(s, (family==AF_INET6? IPPROTO_IPV6:IPPROTO_IP), - IP_BINDANY, (void*)&on, (socklen_t)sizeof(on)) < 0) { - log_warn("setsockopt(.. IP_BINDANY ..) failed: %s", - strerror(errno)); + (family == AF_INET6? IPV6_BINDANY:IP_BINDANY), + (void*)&on, (socklen_t)sizeof(on)) < 0) { + log_warn("setsockopt(.. IP%s_BINDANY ..) failed: %s", + (family==AF_INET6?"V6":""), strerror(errno)); } #endif /* IP_TRANSPARENT || IP_BINDANY */ }