Commit bccc1711 authored by Peter Oskolkov's avatar Peter Oskolkov Committed by David S. Miller

selftests/net: add ipv6 tests to ip_defrag selftest

This patch adds ipv6 defragmentation tests to ip_defrag selftest,
to complement existing ipv4 tests.
Signed-off-by: default avatarPeter Oskolkov <posk@google.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 83619623
This diff is collapsed.
...@@ -6,23 +6,34 @@ ...@@ -6,23 +6,34 @@
set +x set +x
set -e set -e
echo "ipv4 defrag" readonly NETNS="ns-$(mktemp -u XXXXXX)"
setup() {
ip netns add "${NETNS}"
ip -netns "${NETNS}" link set lo up
ip netns exec "${NETNS}" sysctl -w net.ipv4.ipfrag_high_thresh=9000000 &> /dev/null
ip netns exec "${NETNS}" sysctl -w net.ipv4.ipfrag_low_thresh=7000000 &> /dev/null
ip netns exec "${NETNS}" sysctl -w net.ipv6.ip6frag_high_thresh=9000000 &> /dev/null
ip netns exec "${NETNS}" sysctl -w net.ipv6.ip6frag_low_thresh=7000000 &> /dev/null
}
run_v4() { cleanup() {
sysctl -w net.ipv4.ipfrag_high_thresh=9000000 &> /dev/null ip netns del "${NETNS}"
sysctl -w net.ipv4.ipfrag_low_thresh=7000000 &> /dev/null
./ip_defrag -4
} }
export -f run_v4
./in_netns.sh "run_v4" trap cleanup EXIT
setup
echo "ipv4 defrag"
ip netns exec "${NETNS}" ./ip_defrag -4
echo "ipv4 defrag with overlaps" echo "ipv4 defrag with overlaps"
run_v4o() { ip netns exec "${NETNS}" ./ip_defrag -4o
sysctl -w net.ipv4.ipfrag_high_thresh=9000000 &> /dev/null
sysctl -w net.ipv4.ipfrag_low_thresh=7000000 &> /dev/null echo "ipv6 defrag"
./ip_defrag -4o ip netns exec "${NETNS}" ./ip_defrag -6
}
export -f run_v4o echo "ipv6 defrag with overlaps"
ip netns exec "${NETNS}" ./ip_defrag -6o
./in_netns.sh "run_v4o"
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment