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:
@@ -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,
|
||||
|
Reference in New Issue
Block a user