From 9fb45d77fc3944f8d158852c3863cab519bc41c6 Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Wed, 14 Feb 2018 12:53:32 +0000 Subject: [PATCH] Add "IfMTU" configuration option to allow selecting TUN/TAP MTU --- yggdrasil.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/yggdrasil.go b/yggdrasil.go index 9e6cc86a..35d87683 100644 --- a/yggdrasil.go +++ b/yggdrasil.go @@ -40,6 +40,7 @@ type nodeConfig struct { LinkLocal string IfName string IfTAPMode bool + IfMTU int } type node struct { @@ -114,6 +115,7 @@ func generateConfig() *nodeConfig { cfg.Multicast = true cfg.LinkLocal = "" cfg.IfName = "auto" + cfg.IfMTU = 65535 if runtime.GOOS == "windows" { cfg.IfTAPMode = true } else { @@ -264,7 +266,7 @@ func main() { n.init(cfg, logger) logger.Println("Starting tun...") //n.core.DEBUG_startTun(cfg.IfName) // 1280, the smallest supported MTU - n.core.DEBUG_startTunWithMTU(cfg.IfName, cfg.IfTAPMode, 65535) // Largest supported MTU + n.core.DEBUG_startTunWithMTU(cfg.IfName, cfg.IfTAPMode, cfg.IfMTU) // Largest supported MTU defer func() { logger.Println("Closing...") n.core.DEBUG_stopTun()