selftests: pmtu: extend MTU parsing helper to locked MTU
authorSabrina Dubroca <sd@queasysnail.net>
Mon, 8 Oct 2018 12:37:04 +0000 (14:37 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 8 Oct 2018 18:00:23 +0000 (11:00 -0700)
The mtu_parse helper introduced in commit f2c929feeccd ("selftests:
pmtu: Factor out MTU parsing helper") can only handle "mtu 1234", but
not "mtu lock 1234". Extend it, so that we can do IPv4 tests with PMTU
smaller than net.ipv4.route.min_pmtu

Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
Reviewed-by: David Ahern <dsahern@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
tools/testing/selftests/net/pmtu.sh

index 6c38a7637744e576428fec89b449023e095155c0..03e56a27f69caf51b1fc8e39537ab415b2a3da16 100755 (executable)
@@ -196,7 +196,9 @@ mtu_parse() {
 
        next=0
        for i in ${input}; do
+               [ ${next} -eq 1 -a "${i}" = "lock" ] && next=2 && continue
                [ ${next} -eq 1 ] && echo "${i}" && return
+               [ ${next} -eq 2 ] && echo "lock ${i}" && return
                [ "${i}" = "mtu" ] && next=1
        done
 }