xref: /openbmc/linux/tools/testing/selftests/net/ip_defrag.sh (revision dd2934a95701576203b2f61e8ded4e4a2f9183ea)
1#!/bin/sh
2# SPDX-License-Identifier: GPL-2.0
3#
4# Run a couple of IP defragmentation tests.
5
6set +x
7set -e
8
9echo "ipv4 defrag"
10
11run_v4() {
12sysctl -w net.ipv4.ipfrag_high_thresh=9000000 &> /dev/null
13sysctl -w net.ipv4.ipfrag_low_thresh=7000000 &> /dev/null
14./ip_defrag -4
15}
16export -f run_v4
17
18./in_netns.sh "run_v4"
19
20echo "ipv4 defrag with overlaps"
21run_v4o() {
22sysctl -w net.ipv4.ipfrag_high_thresh=9000000 &> /dev/null
23sysctl -w net.ipv4.ipfrag_low_thresh=7000000 &> /dev/null
24./ip_defrag -4o
25}
26export -f run_v4o
27
28./in_netns.sh "run_v4o"
29