chiark / gitweb /
contrib/tripe-ipif.in: Use the new-ish `bulk-overhead' to calculate MTU.
[tripe] / contrib / tripe-ipif.in
index 5a620faf4db9d8be8a8904ef73b3bc289e629613..4384175fcc9e3c1ac3414cb6f80790acf98261fd 100755 (executable)
@@ -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 <<EOF
 $algs
 EOF
-case ,$tagsz,$blksz, in
-  *,nil,*) echo >&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")