From: W.C.A. Wijngaards Date: Thu, 25 Apr 2024 10:53:05 +0000 (+0200) Subject: - Fix to disable fragmentation on systems with IP_DONTFRAG, X-Git-Tag: release-1.20.0rc1~9 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8b490b1540eead63956e8d14373a59d3ff0428e8;p=thirdparty%2Funbound.git - Fix to disable fragmentation on systems with IP_DONTFRAG, with a nonzero value for the socket option argument. --- diff --git a/doc/Changelog b/doc/Changelog index b72729186..d683d1a64 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -3,6 +3,8 @@ - Merge #1041: Stub and Forward unshare. This has one structure for them and fixes #1038: fatal error: Could not initialize thread / error: reading root hints. + - Fix to disable fragmentation on systems with IP_DONTFRAG, + with a nonzero value for the socket option argument. 24 April 2024: Wouter - Fix ci workflow for macos for moved install locations. diff --git a/services/listen_dnsport.c b/services/listen_dnsport.c index 26679941b..7eb59a161 100644 --- a/services/listen_dnsport.c +++ b/services/listen_dnsport.c @@ -612,7 +612,9 @@ create_udp_sock(int family, int socktype, struct sockaddr* addr, # elif defined(IP_DONTFRAG) && !defined(__APPLE__) /* the IP_DONTFRAG option if defined in the 11.0 OSX headers, * but does not work on that version, so we exclude it */ - int off = 0; + /* a nonzero value disables fragmentation, according to + * docs.oracle.com for ip(4). */ + int off = 1; if (setsockopt(s, IPPROTO_IP, IP_DONTFRAG, &off, (socklen_t)sizeof(off)) < 0) { log_err("setsockopt(..., IP_DONTFRAG, ...) failed: %s",