2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-28 21:17:54 +00:00

4505. [port] Use IP_PMTUDISC_OMIT if available. [RT #35494]

This commit is contained in:
Mark Andrews 2016-11-02 17:39:52 +11:00
parent 5f8412a4cb
commit a61f252391
2 changed files with 18 additions and 3 deletions

View File

@ -1,3 +1,5 @@
4505. [port] Use IP_PMTUDISC_OMIT if available. [RT #35494]
4504. [security] Allow the maximum number of records in a zone to
be specified. This provides a control for issues
raised in CVE-2016-6170. [RT #42143]

View File

@ -2858,11 +2858,24 @@ opensocket(isc__socketmgr_t *manager, isc__socket_t *sock,
#if defined(IP_MTU_DISCOVER) && defined(IP_PMTUDISC_DONT)
/*
* Turn off Path MTU discovery on IPv4/UDP sockets.
* Prefer IP_PMTUDISC_OMIT over IP_PMTUDISC_DONT
* if it available.
*/
if (sock->pf == AF_INET) {
int action = IP_PMTUDISC_DONT;
(void)setsockopt(sock->fd, IPPROTO_IP, IP_MTU_DISCOVER,
int action;
#ifdef defined(IP_PMTUDISC_OMIT)
action = IP_PMTUDISC_OMIT;
if (setsockopt(sock->fd, IPPROTO_IPV6,
IPV6_MTU_DISCOVER, &action,
sizeof(action)) < 0) {
#endif
action = IP_PMTUDISC_DONT;
(void)setsockopt(sock->fd, IPPROTO_IP,
IP_MTU_DISCOVER,
&action, sizeof(action));
#ifdef defined(IP_PMTUDISC_OMIT)
}
#endif
}
#endif
#if defined(IP_DONTFRAG)