]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Add a regression test in the RRL system test
authorEvan Hunt <each@isc.org>
Wed, 28 Jul 2021 00:55:08 +0000 (17:55 -0700)
committerPetr Špaček <pspacek@isc.org>
Mon, 30 Aug 2021 15:31:43 +0000 (17:31 +0200)
This commit modifies the MTU of the loopback interface on
Linux systems to 1500, so that oversized UDP packets can
trigger EMSGSIZE errors, and tests that named handles
such errors correctly.

Note that the loopback MTU size has not yet been modified
for other platforms.

(cherry picked from commit cfd058d622102c18ea9b6ef9cd37530d62debea7)

bin/tests/system/ifconfig.sh
bin/tests/system/rrl/ns4/named.conf.in
bin/tests/system/rrl/ns4/tld4.db
bin/tests/system/rrl/tests.sh

index 9ba36b20212189ccc11d67242c23a45ce7de9d28..4d323872afeba395ab13fb8e33897b0987df095d 100755 (executable)
@@ -19,6 +19,9 @@
 #       fd92:7065:b8e:99ff::{1..2}
 #       fd92:7065:b8e:ff::{1..2}
 #
+# On Linux, we also set the MTU on the 1500 bytes to match the default MTU on
+# physical interfaces, so we can properly test the cases with packets bigger
+# than interface MTU.
 
 SYSTEMTESTTOP="$(cd -P -- "$(dirname -- "$0")" && pwd -P)"
 . "$SYSTEMTESTTOP/conf.sh"
@@ -76,12 +79,14 @@ case "$1" in
                                 if [ $use_ip ]; then
                                         ip address add 10.53.$i.$ns/24 \
                                             dev lo:$int
+                                        ip link set dev lo:$int mtu 1500
                                         [ "$ipv6" ] && ip address add \
                                             fd92:7065:b8e:${ipv6}ff::$ns/64 \
                                             dev lo
                                 else
                                         ifconfig lo:$int 10.53.$i.$ns up \
-                                                netmask 255.255.255.0
+                                                netmask 255.255.255.0 \
+                                                mtu 1500
                                         [ "$ipv6" ] && ifconfig lo inet6 add \
                                                 fd92:7065:b8e:${ipv6}ff::$ns/64
                                 fi
index 028281fe7417e978eb37ee2ca997d3c4c5bacf81..864b67f25dda80828a9bfd9f7b5d742f2b84cf1e 100644 (file)
@@ -22,6 +22,7 @@ options {
        notify no;
        recursion yes;
        dnssec-validation yes;
+       max-udp-size 4096;
 
        rate-limit {
            responses-per-second 2;
index 5b746a01ab3d478f3518895070894139db3d77db..1527775ca7d75ed144a898ad202f6a8d1f84d7b0 100644 (file)
@@ -40,3 +40,6 @@ a8            A       192.0.2.8
 
 ; a9 for all-per-second limit
 $GENERATE 101-180 all$.a9 A 192.0.2.8
+
+; oversized TXT record
+$GENERATE 1-100    big    1    TXT    "txt$"
index 9b8c81074802d6175a9ccdf279b5b5bd2866bfb5..31855c453ca8e346a58ec633165eb9d14d886831 100644 (file)
@@ -272,6 +272,10 @@ $DIG $DIGOPTS @$ns4 A a7.tld4 > /dev/null 2>&1
 $DIG $DIGOPTS @$ns4 A a7.tld4 > /dev/null 2>&1
 $DIG $DIGOPTS @$ns4 A a7.tld4 > /dev/null 2>&1
 
+# regression test for GL #2839
+DIGOPTS="+bufsize=4096 +ignore -p ${PORT}"
+$DIG $DIGOPTS @$ns4 TXT big.tld4 > /dev/null 2>&1
+
 grep "would limit" ns4/named.run >/dev/null 2>&1 ||
 setret "\"would limit\" not found in log file."