Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: vpnc: devel
svn commit: vpnc r494 - /branches/vpnc-nortel/vpnc-script /trunk/vpnc-script
 

Index | Next | Previous | View Flat


vpnc at unix-ag

Jan 13, 2012, 11:55 PM


Views: 268
Permalink
svn commit: vpnc r494 - /branches/vpnc-nortel/vpnc-script /trunk/vpnc-script

Author: Antonio Borneo
Date: Sat Jan 14 08:55:39 2012
New Revision: 494

Log:
vpnc-script: prevent negative MTU

We can't be sure that the route shown by 'ip route get' will return
anything. Restructure the logic to only perform the subtraction if it
does. Otherwise, fall back to the default 1412.

Signed-off-by: Dave Reisner <dreisner [at] archlinux>

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:39 2012
@@ -96,8 +96,13 @@
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') - 88))
- else
+ MTU=$($IPROUTE route get "$VPNGATEWAY" | sed -ne 's/^.*mtu \([[:digit:]]\+\).*$/\1/p')
+ if [ -n "$MTU" ]; then
+ MTU=$(( "$MTU" - 88 ))
+ fi
+ fi
+
+ if [ -z "$MTU" ]; then
MTU=1412
fi


Modified: trunk/vpnc-script
==============================================================================
--- trunk/vpnc-script (original)
+++ trunk/vpnc-script Sat Jan 14 08:55:39 2012
@@ -96,8 +96,13 @@
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') - 88))
- else
+ MTU=$($IPROUTE route get "$VPNGATEWAY" | sed -ne 's/^.*mtu \([[:digit:]]\+\).*$/\1/p')
+ if [ -n "$MTU" ]; then
+ MTU=$(( "$MTU" - 88 ))
+ fi
+ fi
+
+ if [ -z "$MTU" ]; then
MTU=1412
fi


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

Subject User Time
svn commit: vpnc r494 - /branches/vpnc-nortel/vpnc-script /trunk/vpnc-script vpnc at unix-ag Jan 13, 2012, 11:55 PM

  Index | Next | Previous | View Flat
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.