summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorStefano Brivio <sbrivio@redhat.com>2018-03-17 04:31:43 +0300
committerDavid S. Miller <davem@davemloft.net>2018-03-18 03:15:14 +0300
commit35b49424b8a49edb6de6e7ec54bd8edb568031c2 (patch)
tree6616f620204f82933a6669d6b67bafd3ae5aa87b /tools
parenta41c789bdcc1e3d8fe0d82ee80c22aa4f4508004 (diff)
downloadlinux-35b49424b8a49edb6de6e7ec54bd8edb568031c2.tar.xz
selftests: pmtu: Add pmtu_vti6_default_mtu test
Same as pmtu_vti4_default_mtu, but on IPv6 with vti6. Signed-off-by: Stefano Brivio <sbrivio@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'tools')
-rwxr-xr-xtools/testing/selftests/net/pmtu.sh18
1 files changed, 17 insertions, 1 deletions
diff --git a/tools/testing/selftests/net/pmtu.sh b/tools/testing/selftests/net/pmtu.sh
index be13b3232c12..5d9af22b360a 100755
--- a/tools/testing/selftests/net/pmtu.sh
+++ b/tools/testing/selftests/net/pmtu.sh
@@ -18,10 +18,14 @@
# endpoints. Check that MTU assigned to vti interface is the MTU of the
# lower layer (veth) minus additional lower layer headers (zero, for veth)
# minus IPv4 header length
+#
+# - pmtu_vti6_default_mtu
+# Same as above, for IPv6
tests="
pmtu_vti6_exception vti6: PMTU exceptions
- pmtu_vti4_default_mtu vti4: default MTU assignment"
+ pmtu_vti4_default_mtu vti4: default MTU assignment
+ pmtu_vti6_default_mtu vti6: default MTU assignment"
NS_A="ns-$(mktemp -u XXXXXX)"
NS_B="ns-$(mktemp -u XXXXXX)"
@@ -225,6 +229,18 @@ test_pmtu_vti4_default_mtu() {
fi
}
+test_pmtu_vti6_default_mtu() {
+ setup namespaces veth vti6 || return 2
+
+ # Check that MTU of vti device is MTU of veth minus IPv6 header length
+ veth_mtu="$(link_get_mtu "${ns_a}" veth_a)"
+ vti6_mtu="$(link_get_mtu "${ns_a}" vti6_a)"
+ if [ $((veth_mtu - vti6_mtu)) -ne 40 ]; then
+ err " vti MTU ${vti6_mtu} is not veth MTU ${veth_mtu} minus IPv6 header length"
+ return 1
+ fi
+}
+
trap cleanup EXIT
exitcode=0