2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-09-05 09:05:40 +00:00

2444. [port] Linux, FreeBSD, AIX: Turn of path mtu discovery

(clear DF) for UDP responses and requests.
This commit is contained in:
Mark Andrews
2008-09-23 02:20:21 +00:00
parent 1de4dea98c
commit c6c09f77f8
2 changed files with 25 additions and 1 deletions

View File

@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: socket.c,v 1.302 2008/09/04 05:56:43 marka Exp $ */
/* $Id: socket.c,v 1.303 2008/09/23 02:20:21 marka Exp $ */
/*! \file */
@@ -2031,6 +2031,27 @@ opensocket(isc_socketmgr_t *manager, isc_socket_t *sock) {
#endif /* ISC_PLATFORM_HAVEIPV6 */
#endif /* defined(USE_CMSG) */
#if defined(IP_MTU_DISCOVER) && defined(IP_PMTUDISC_DONT)
/*
* Turn off Path MTU discovery on IPv4/UDP sockets.
*/
if (sock->pf == AF_INET) {
int action = IP_PMTUDISC_DONT;
(void)setsockopt(sock->fd, IPPROTO_IP, IP_MTU_DISCOVER,
&action, sizeof(action));
}
#endif
#if defined(IP_DONTFRAG)
/*
* Turn off Path MTU discovery on IPv4/UDP sockets.
*/
if (sock->pf == AF_INET) {
int off = 0;
(void)setsockopt(sock->fd, IPPROTO_IP, IP_DONTFRAG,
&off, sizeof(off));
}
#endif
#if defined(SO_RCVBUF)
optlen = sizeof(size);
if (getsockopt(sock->fd, SOL_SOCKET, SO_RCVBUF,