mirror of
https://github.com/NLnetLabs/unbound.git
synced 2025-12-23 16:20:26 -05:00
- Fix #634: fix fail to start on Linux LTS 3.14.X, ignores missing
IP_MTU_DISCOVER OMIT option. git-svn-id: file:///svn/unbound/trunk@3298 be551aaa-1e26-0410-a405-d3ace91eadb9
This commit is contained in:
parent
724a4f3ae0
commit
ac5ccb6db6
2 changed files with 38 additions and 18 deletions
|
|
@ -6,6 +6,8 @@
|
||||||
- print query name when max target count is exceeded.
|
- print query name when max target count is exceeded.
|
||||||
- patch from Brad Smith that fixes DESTDIR in unbound-control-setup
|
- patch from Brad Smith that fixes DESTDIR in unbound-control-setup
|
||||||
for installs where config is not in the prefix location.
|
for installs where config is not in the prefix location.
|
||||||
|
- Fix #634: fix fail to start on Linux LTS 3.14.X, ignores missing
|
||||||
|
IP_MTU_DISCOVER OMIT option.
|
||||||
|
|
||||||
9 December 2014: Wouter
|
9 December 2014: Wouter
|
||||||
- svn trunk has 1.5.2 in development.
|
- svn trunk has 1.5.2 in development.
|
||||||
|
|
|
||||||
|
|
@ -368,29 +368,47 @@ create_udp_sock(int family, int socktype, struct sockaddr* addr,
|
||||||
* (and also uses the interface mtu to determine the size of the packets).
|
* (and also uses the interface mtu to determine the size of the packets).
|
||||||
* So there won't be any EMSGSIZE error. Against DNS fragmentation attacks.
|
* So there won't be any EMSGSIZE error. Against DNS fragmentation attacks.
|
||||||
* FreeBSD already has same semantics without setting the option. */
|
* FreeBSD already has same semantics without setting the option. */
|
||||||
# if defined(IP_PMTUDISC_OMIT)
|
int omit_set = 0;
|
||||||
int action = IP_PMTUDISC_OMIT;
|
int action;
|
||||||
# else
|
# if defined(IP_PMTUDISC_OMIT)
|
||||||
int action = IP_PMTUDISC_DONT;
|
action = IP_PMTUDISC_OMIT;
|
||||||
# endif
|
|
||||||
if (setsockopt(s, IPPROTO_IP, IP_MTU_DISCOVER,
|
if (setsockopt(s, IPPROTO_IP, IP_MTU_DISCOVER,
|
||||||
&action, (socklen_t)sizeof(action)) < 0) {
|
&action, (socklen_t)sizeof(action)) < 0) {
|
||||||
log_err("setsockopt(..., IP_MTU_DISCOVER, "
|
|
||||||
# if defined(IP_PMTUDISC_OMIT)
|
if (errno != EINVAL) {
|
||||||
"IP_PMTUDISC_OMIT"
|
log_err("setsockopt(..., IP_MTU_DISCOVER, IP_PMTUDISC_OMIT...) failed: %s",
|
||||||
# else
|
strerror(errno));
|
||||||
"IP_PMTUDISC_DONT"
|
|
||||||
# endif
|
|
||||||
"...) failed: %s",
|
|
||||||
strerror(errno));
|
|
||||||
# ifndef USE_WINSOCK
|
# ifndef USE_WINSOCK
|
||||||
close(s);
|
close(s);
|
||||||
# else
|
# else
|
||||||
closesocket(s);
|
closesocket(s);
|
||||||
# endif
|
# endif
|
||||||
*noproto = 0;
|
*noproto = 0;
|
||||||
*inuse = 0;
|
*inuse = 0;
|
||||||
return -1;
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
omit_set = 1;
|
||||||
|
}
|
||||||
|
# endif
|
||||||
|
if (omit_set == 0) {
|
||||||
|
action = IP_PMTUDISC_DONT;
|
||||||
|
if (setsockopt(s, IPPROTO_IP, IP_MTU_DISCOVER,
|
||||||
|
&action, (socklen_t)sizeof(action)) < 0) {
|
||||||
|
log_err("setsockopt(..., IP_MTU_DISCOVER, IP_PMTUDISC_DONT...) failed: %s",
|
||||||
|
strerror(errno));
|
||||||
|
# ifndef USE_WINSOCK
|
||||||
|
close(s);
|
||||||
|
# else
|
||||||
|
closesocket(s);
|
||||||
|
# endif
|
||||||
|
*noproto = 0;
|
||||||
|
*inuse = 0;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
# elif defined(IP_DONTFRAG)
|
# elif defined(IP_DONTFRAG)
|
||||||
int off = 0;
|
int off = 0;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue