From 32c61bab4b68feda145d1335771881a587d66cee Mon Sep 17 00:00:00 2001 From: teastep Date: Wed, 11 Apr 2007 18:36:10 +0000 Subject: [PATCH] Increment library version git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@5897 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb --- Shorewall-common/lib.base | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/Shorewall-common/lib.base b/Shorewall-common/lib.base index 24d3ff2a4..13c3dab67 100644 --- a/Shorewall-common/lib.base +++ b/Shorewall-common/lib.base @@ -28,7 +28,7 @@ # and /usr/share/shorewall-lite/shorecap. # -SHOREWALL_LIBVERSION=30402 +SHOREWALL_LIBVERSION=30403 [ -n "${VARDIR:=/var/lib/shorewall}" ] [ -n "${SHAREDIR:=/usr/share/shorewall}" ] @@ -1352,7 +1352,7 @@ delete_tc1() } # -# Detect a device's MTU +# Detect a device's MTU -- echos the passed device's MTU + 100 # get_device_mtu() # $1 = device { @@ -1365,6 +1365,23 @@ get_device_mtu() # $1 = device fi } +# +# Version of the above that doesn't generate any output for MTU 1500 +# +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) + if [ -n "$mtu" ]; then + [ $mtu = 1500 ] || echo mtu $(($mtu + 100)) + fi + fi + +} + # # Undo changes to routing #