Mailing List Archive

svn commit: vpnc r496 - /branches/vpnc-nortel/vpnc-script /trunk/vpnc-script
Author: Antonio Borneo
Date: Sat Jan 14 08:55:52 2012
New Revision: 496

Log:
Fix MTU calculation (Red Hat bug #693235)

Newer iproute doesn't give the mtu in 'ip route get' output, so get the
device and then get the device's MTU (which theoretically could be
different to the route MTU but this is good enough for now).

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>

Modified:
branches/vpnc-nortel/vpnc-script
trunk/vpnc-script

Modified: branches/vpnc-nortel/vpnc-script
==============================================================================
--- branches/vpnc-nortel/vpnc-script (original)
+++ branches/vpnc-nortel/vpnc-script Sat Jan 14 08:55:52 2012
@@ -96,7 +96,8 @@
if [ -n "$INTERNAL_IP4_MTU" ]; then
MTU=$INTERNAL_IP4_MTU
elif [ -n "$IPROUTE" ]; then
- MTU=$($IPROUTE route get "$VPNGATEWAY" | sed -ne 's/^.*mtu \([[:digit:]]\+\).*$/\1/p')
+ MTUDEV=$($IPROUTE route get "$VPNGATEWAY" | sed -ne 's/^.*dev \([a-z0-9]*\).*$/\1/p')
+ MTU=$($IPROUTE link show "$MTUDEV" | sed -ne 's/^.*mtu \([[:digit:]]\+\).*$/\1/p')
if [ -n "$MTU" ]; then
MTU=$(( "$MTU" - 88 ))
fi

Modified: trunk/vpnc-script
==============================================================================
--- trunk/vpnc-script (original)
+++ trunk/vpnc-script Sat Jan 14 08:55:52 2012
@@ -96,7 +96,8 @@
if [ -n "$INTERNAL_IP4_MTU" ]; then
MTU=$INTERNAL_IP4_MTU
elif [ -n "$IPROUTE" ]; then
- MTU=$($IPROUTE route get "$VPNGATEWAY" | sed -ne 's/^.*mtu \([[:digit:]]\+\).*$/\1/p')
+ MTUDEV=$($IPROUTE route get "$VPNGATEWAY" | sed -ne 's/^.*dev \([a-z0-9]*\).*$/\1/p')
+ MTU=$($IPROUTE link show "$MTUDEV" | sed -ne 's/^.*mtu \([[:digit:]]\+\).*$/\1/p')
if [ -n "$MTU" ]; then
MTU=$(( "$MTU" - 88 ))
fi

_______________________________________________
vpnc-devel mailing list
vpnc-devel@unix-ag.uni-kl.de
https://lists.unix-ag.uni-kl.de/mailman/listinfo/vpnc-devel
http://www.unix-ag.uni-kl.de/~massar/vpnc/