Skip to content

Commit

Permalink
selftests: pmtu: extend MTU parsing helper to locked MTU
Browse files Browse the repository at this point in the history
The mtu_parse helper introduced in commit f2c929f ("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 <[email protected]>
Reviewed-by: David Ahern <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
qsn authored and davem330 committed Oct 8, 2018
1 parent 1e0a720 commit 72ebddd
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tools/testing/selftests/net/pmtu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 72ebddd

Please sign in to comment.