mirror of
https://github.com/NLnetLabs/unbound.git
synced 2025-12-24 00:29:58 -05:00
- ip-transparent option for FreeBSD with IP_BINDANY socket option.
git-svn-id: file:///svn/unbound/trunk@3623 be551aaa-1e26-0410-a405-d3ace91eadb9
This commit is contained in:
parent
6f1272bcdc
commit
85de673b6b
4 changed files with 15 additions and 4 deletions
|
|
@ -1,3 +1,6 @@
|
||||||
|
15 February 2016: Wouter
|
||||||
|
- ip-transparent option for FreeBSD with IP_BINDANY socket option.
|
||||||
|
|
||||||
9 February 2016: Wouter
|
9 February 2016: Wouter
|
||||||
- Test for type OPENPGPKEY.
|
- Test for type OPENPGPKEY.
|
||||||
- insecure-lan-zones: yesno config option, patch from Dag-Erling
|
- insecure-lan-zones: yesno config option, patch from Dag-Erling
|
||||||
|
|
|
||||||
|
|
@ -90,6 +90,7 @@ server:
|
||||||
|
|
||||||
# use IP_TRANSPARENT so the interface: addresses can be non-local
|
# use IP_TRANSPARENT so the interface: addresses can be non-local
|
||||||
# and you can config non-existing IPs that are going to work later on
|
# and you can config non-existing IPs that are going to work later on
|
||||||
|
# (uses IP_BINDANY on FreeBSD).
|
||||||
# ip-transparent: no
|
# ip-transparent: no
|
||||||
|
|
||||||
# EDNS reassembly buffer to advertise to UDP peers (the actual buffer
|
# EDNS reassembly buffer to advertise to UDP peers (the actual buffer
|
||||||
|
|
|
||||||
|
|
@ -275,7 +275,7 @@ are going to exist later on, with host failover configuration. This is
|
||||||
a lot like interface\-automatic, but that one services all interfaces
|
a lot like interface\-automatic, but that one services all interfaces
|
||||||
and with this option you can select which (future) interfaces unbound
|
and with this option you can select which (future) interfaces unbound
|
||||||
provides service on. This option needs unbound to be started with root
|
provides service on. This option needs unbound to be started with root
|
||||||
permissions on some systems.
|
permissions on some systems. The option uses IP_BINDANY on FreeBSD systems.
|
||||||
.TP
|
.TP
|
||||||
.B rrset\-cache\-size: \fI<number>
|
.B rrset\-cache\-size: \fI<number>
|
||||||
Number of bytes size of the RRset cache. Default is 4 megabytes.
|
Number of bytes size of the RRset cache. Default is 4 megabytes.
|
||||||
|
|
|
||||||
|
|
@ -99,7 +99,7 @@ create_udp_sock(int family, int socktype, struct sockaddr* addr,
|
||||||
int rcv, int snd, int listen, int* reuseport, int transparent)
|
int rcv, int snd, int listen, int* reuseport, int transparent)
|
||||||
{
|
{
|
||||||
int s;
|
int s;
|
||||||
#if defined(SO_REUSEADDR) || defined(SO_REUSEPORT) || defined(IPV6_USE_MIN_MTU) || defined(IP_TRANSPARENT)
|
#if defined(SO_REUSEADDR) || defined(SO_REUSEPORT) || defined(IPV6_USE_MIN_MTU) || defined(IP_TRANSPARENT) || defined(IP_BINDANY)
|
||||||
int on=1;
|
int on=1;
|
||||||
#endif
|
#endif
|
||||||
#ifdef IPV6_MTU
|
#ifdef IPV6_MTU
|
||||||
|
|
@ -114,7 +114,7 @@ create_udp_sock(int family, int socktype, struct sockaddr* addr,
|
||||||
#ifndef IPV6_V6ONLY
|
#ifndef IPV6_V6ONLY
|
||||||
(void)v6only;
|
(void)v6only;
|
||||||
#endif
|
#endif
|
||||||
#ifndef IP_TRANSPARENT
|
#if !defined(IP_TRANSPARENT) && !defined(IP_BINDANY)
|
||||||
(void)transparent;
|
(void)transparent;
|
||||||
#endif
|
#endif
|
||||||
if((s = socket(family, socktype, 0)) == -1) {
|
if((s = socket(family, socktype, 0)) == -1) {
|
||||||
|
|
@ -187,7 +187,14 @@ create_udp_sock(int family, int socktype, struct sockaddr* addr,
|
||||||
log_warn("setsockopt(.. IP_TRANSPARENT ..) failed: %s",
|
log_warn("setsockopt(.. IP_TRANSPARENT ..) failed: %s",
|
||||||
strerror(errno));
|
strerror(errno));
|
||||||
}
|
}
|
||||||
#endif /* IP_TRANSPARENT */
|
#elif defined(IP_BINDANY)
|
||||||
|
if (transparent &&
|
||||||
|
setsockopt(s, IPPROTO_IP, IP_BINDANY, (void*)&on,
|
||||||
|
(socklen_t)sizeof(on)) < 0) {
|
||||||
|
log_warn("setsockopt(.. IP_BINDANY ..) failed: %s",
|
||||||
|
strerror(errno));
|
||||||
|
}
|
||||||
|
#endif /* IP_TRANSPARENT || IP_BINDANY */
|
||||||
}
|
}
|
||||||
if(rcv) {
|
if(rcv) {
|
||||||
#ifdef SO_RCVBUF
|
#ifdef SO_RCVBUF
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue