]> git.ipfire.org Git - thirdparty/bind9.git/commit
Disable the Path MTU Discover on UDP Sockets
authorOndřej Surý <ondrej@sury.org>
Wed, 28 Jul 2021 13:55:46 +0000 (15:55 +0200)
committerMichał Kępień <michal@isc.org>
Tue, 10 Aug 2021 10:46:54 +0000 (12:46 +0200)
commitf9571bbc5fd7ca7067e80058758fc7b5be8b951a
treea463f57fe2eceb44c1aa9b7471a8f0e7f719f7a7
parent7d3d1b8f1b928bd460d8ae02634762322a6cd6bf
Disable the Path MTU Discover on UDP Sockets

Instead of disabling the fragmentation on the UDP sockets, we now
disable the Path MTU Discovery by setting IP(V6)_MTU_DISCOVER socket
option to IP_PMTUDISC_OMIT on Linux and disabling IP(V6)_DONTFRAG socket
option on FreeBSD.  This option sets DF=0 in the IP header and also
ignores the Path MTU Discovery.

As additional mitigation on Linux, we recommend setting
net.ipv4.ip_no_pmtu_disc to Mode 3:

    Mode 3 is a hardend pmtu discover mode. The kernel will only accept
    fragmentation-needed errors if the underlying protocol can verify
    them besides a plain socket lookup. Current protocols for which pmtu
    events will be honored are TCP, SCTP and DCCP as they verify
    e.g. the sequence number or the association. This mode should not be
    enabled globally but is only intended to secure e.g. name servers in
    namespaces where TCP path mtu must still work but path MTU
    information of other protocols should be discarded. If enabled
    globally this mode could break other protocols.
lib/isc/netmgr/netmgr-int.h
lib/isc/netmgr/netmgr.c
lib/isc/netmgr/udp.c
lib/isc/unix/socket.c