From: Mark Wooding Date: Tue, 23 May 2017 10:13:59 +0000 (+0100) Subject: contrib/tripe-ipif.in: Use the new-ish `bulk-overhead' to calculate MTU. X-Git-Tag: 1.5.0~159 X-Git-Url: https://git.distorted.org.uk/~mdw/tripe/commitdiff_plain/3849487aed0a812997e01e4a6eafd4b1567385d1 contrib/tripe-ipif.in: Use the new-ish `bulk-overhead' to calculate MTU. --- 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")