From 3849487aed0a812997e01e4a6eafd4b1567385d1 Mon Sep 17 00:00:00 2001 Message-Id: <3849487aed0a812997e01e4a6eafd4b1567385d1.1715306903.git.mdw@distorted.org.uk> From: Mark Wooding Date: Tue, 23 May 2017 11:13:59 +0100 Subject: [PATCH] contrib/tripe-ipif.in: Use the new-ish `bulk-overhead' to calculate MTU. Organization: Straylight/Edgeware From: Mark Wooding --- contrib/tripe-ipif.in | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/contrib/tripe-ipif.in b/contrib/tripe-ipif.in index 5a620faf..4384175f 100755 --- a/contrib/tripe-ipif.in +++ b/contrib/tripe-ipif.in @@ -90,19 +90,16 @@ esac echo "userv-$peer" ## Now we can interrogate the server without deadlocking it. -algs=$(tripectl algs) tagsz=nil blksz=nil +algs=$(tripectl algs) overhead=nil while read line; do for i in $line; do - case $i in - cipher-blksz=*) blksz=${i#*=} ;; - mac-tagsz=*) tagsz=${i#*=} ;; - esac + case $i in bulk-overhead=*) overhead=${i#*=} ;; esac done done <&2 "$quis[$$]: failed to discover cipher suite"; exit 1 ;; +case $overhead in + nil) echo >&2 "$quis[$$]: failed to discover overhead"; exit 1 ;; esac ## Determine the remote address if none is specified; strip off a port number @@ -123,7 +120,7 @@ esac ## Determine the MTU based on the path. pmtu=$(pathmtu $remote_ext) -mtu=$(( $pmtu - 33 - $tagsz - $blksz )) +mtu=$(( $pmtu - 29 - $overhead )) ## Obtain the tunnel and run it. now=$(date +"%Y-%m-%d %H:%M:%S") -- [mdw]