Don't specify MTU in tc add class commands unless necessary

git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@5896 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
teastep
2007-04-11 17:55:18 +00:00
parent 4fc6f1e3ea
commit 89d2ff16ab
2 changed files with 18 additions and 2 deletions

View File

@ -150,3 +150,18 @@ restore_dynamic_rules() {
fi
}
get_device_mtu1() # $1 = device
{
local output="$(ip link ls dev $1 2> /dev/null)" # quotes required for /bin/ash
local mtu
if [ -n "$output" ]; then
mtu=$(find_mtu $output)
else
return
fi
if [ -n "$mtu" ]; then
[ $mtu = 1500 ] || echo mtu $(($mtu + 100))
fi
}