]> Cypherpunks.ru repositories - govpn.git/blobdiff - src/govpn/common.go
Allow 9000 MTUs on TAP interfaces, consider Ethernet header size
[govpn.git] / src / govpn / common.go
index e1bd28ce9c88af2f1e98a6e1fa8dd6f5b2767826..d3f8ec04a595ad62cf960ccfd1ca70310411212f 100644 (file)
@@ -23,15 +23,16 @@ import (
        "os"
        "os/exec"
        "runtime"
-       "time"
 )
 
 const (
        TimeoutDefault = 60
+       EtherSize      = 14
+       MTUMax         = 9000 + EtherSize
+       MTUDefault     = 1500 + EtherSize
 )
 
 var (
-       MTU     int
        Version string
 )
 
@@ -63,10 +64,3 @@ func SliceZero(data []byte) {
 func VersionGet() string {
        return "GoVPN version " + Version + " built with " + runtime.Version()
 }
-
-func cprCycleCalculate(rate int) time.Duration {
-       if rate == 0 {
-               return time.Duration(0)
-       }
-       return time.Second / time.Duration(rate*(1<<10)/MTU)
-}