]> 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:18:35 +0000 (12:18 +0200)
commitdd2746d81019504827278efa3e841daf2d459166
treed0385c3a9464656b4d9fe22f726511ef7e326e31
parent893b2a794a1bd9850a84ff2c29f70355fd43ecf1
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/socket.c