Minor tweaks to mtu change

git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@5899 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
teastep 2007-04-11 20:51:36 +00:00
parent eb46abd16a
commit 4b1e5f1083
2 changed files with 10 additions and 7 deletions

View File

@ -1352,7 +1352,7 @@ delete_tc1()
}
#
# Detect a device's MTU -- echos the passed device's MTU + 100
# Detect a device's MTU -- echos the passed device's MTU
#
get_device_mtu() # $1 = device
{
@ -1366,7 +1366,8 @@ get_device_mtu() # $1 = device
}
#
# Version of the above that doesn't generate any output for MTU 1500
# Version of the above that doesn't generate any output for MTU 1500.
# Generates 'mtu <mtu+>' otherwise, where <mtu+> is the device's MTU + 100
#
get_device_mtu1() # $1 = device
{

View File

@ -150,6 +150,10 @@ restore_dynamic_rules() {
fi
}
#
# The following functions also appear in lib.base. They are duplicated here so that
# restore scripts from prior versions continue to work.
#
get_device_mtu1() # $1 = device
{
local output="$(ip link ls dev $1 2> /dev/null)" # quotes required for /bin/ash
@ -157,11 +161,9 @@ get_device_mtu1() # $1 = device
if [ -n "$output" ]; then
mtu=$(find_mtu $output)
else
return
if [ -n "$mtu" ]; then
[ $mtu = 1500 ] || echo mtu $(($mtu + 100))
fi
fi
if [ -n "$mtu" ]; then
[ $mtu = 1500 ] || echo mtu $(($mtu + 100))
fi
}