From 1692bd98fd78a452a37e6c12d71f4da37c536ef2 Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Sat, 7 Jul 2018 12:08:52 +0100 Subject: [PATCH 1/3] Centralise platform defaults into the 'defaults' package --- src/yggdrasil/admin.go | 8 +++++--- src/yggdrasil/core.go | 14 ++++++++++---- src/yggdrasil/defaults/defaults.go | 15 +++++++++++++++ src/yggdrasil/defaults/defaults_darwin.go | 18 ++++++++++++++++++ src/yggdrasil/defaults/defaults_freebsd.go | 18 ++++++++++++++++++ src/yggdrasil/defaults/defaults_linux.go | 18 ++++++++++++++++++ src/yggdrasil/defaults/defaults_netbsd.go | 18 ++++++++++++++++++ src/yggdrasil/defaults/defaults_openbsd.go | 18 ++++++++++++++++++ src/yggdrasil/defaults/defaults_other.go | 18 ++++++++++++++++++ src/yggdrasil/defaults/defaults_windows.go | 18 ++++++++++++++++++ src/yggdrasil/tun.go | 18 +++++------------- src/yggdrasil/tun_darwin.go | 11 ----------- src/yggdrasil/tun_freebsd.go | 12 ------------ src/yggdrasil/tun_linux.go | 11 ----------- src/yggdrasil/tun_netbsd.go | 12 ------------ src/yggdrasil/tun_openbsd.go | 12 ------------ src/yggdrasil/tun_other.go | 11 ----------- src/yggdrasil/tun_windows.go | 11 ----------- yggdrasil.go | 9 +++++---- yggdrasilctl.go | 4 +++- 20 files changed, 169 insertions(+), 105 deletions(-) create mode 100644 src/yggdrasil/defaults/defaults.go create mode 100644 src/yggdrasil/defaults/defaults_darwin.go create mode 100644 src/yggdrasil/defaults/defaults_freebsd.go create mode 100644 src/yggdrasil/defaults/defaults_linux.go create mode 100644 src/yggdrasil/defaults/defaults_netbsd.go create mode 100644 src/yggdrasil/defaults/defaults_openbsd.go create mode 100644 src/yggdrasil/defaults/defaults_other.go create mode 100644 src/yggdrasil/defaults/defaults_windows.go delete mode 100644 src/yggdrasil/tun_freebsd.go delete mode 100644 src/yggdrasil/tun_netbsd.go delete mode 100644 src/yggdrasil/tun_openbsd.go diff --git a/src/yggdrasil/admin.go b/src/yggdrasil/admin.go index bd5eb0c8..f486468e 100644 --- a/src/yggdrasil/admin.go +++ b/src/yggdrasil/admin.go @@ -13,6 +13,8 @@ import ( "strings" "sync/atomic" "time" + + "yggdrasil/defaults" ) // TODO: Add authentication @@ -155,15 +157,15 @@ func (a *admin) init(c *Core, listenaddr string) { }) a.addHandler("setTunTap", []string{"name", "[tap_mode]", "[mtu]"}, func(in admin_info) (admin_info, error) { // Set sane defaults - iftapmode := getDefaults().defaultIfTAPMode - ifmtu := getDefaults().defaultIfMTU + iftapmode := defaults.GetDefaults().DefaultIfTAPMode + ifmtu := defaults.GetDefaults().DefaultIfMTU // Has TAP mode been specified? if tap, ok := in["tap_mode"]; ok { iftapmode = tap.(bool) } // Check we have enough params for MTU if mtu, ok := in["mtu"]; ok { - if mtu.(float64) >= 1280 && ifmtu <= getDefaults().maximumIfMTU { + if mtu.(float64) >= 1280 && ifmtu <= defaults.GetDefaults().MaximumIfMTU { ifmtu = int(in["mtu"].(float64)) } } diff --git a/src/yggdrasil/core.go b/src/yggdrasil/core.go index 6d130d81..28ca8f30 100644 --- a/src/yggdrasil/core.go +++ b/src/yggdrasil/core.go @@ -9,6 +9,7 @@ import ( "regexp" "yggdrasil/config" + "yggdrasil/defaults" ) // The Core object represents the Yggdrasil node. You should create a Core @@ -197,26 +198,31 @@ func (c *Core) AddAllowedEncryptionPublicKey(boxStr string) error { return c.admin.addAllowedEncryptionPublicKey(boxStr) } +// Gets the default admin listen address for your platform. +func (c *Core) GetAdminDefaultListen() string { + return defaults.GetDefaults().DefaultAdminListen +} + // Gets the default TUN/TAP interface name for your platform. func (c *Core) GetTUNDefaultIfName() string { - return getDefaults().defaultIfName + return defaults.GetDefaults().DefaultIfName } // Gets the default TUN/TAP interface MTU for your platform. This can be as high // as 65535, depending on platform, but is never lower than 1280. func (c *Core) GetTUNDefaultIfMTU() int { - return getDefaults().defaultIfMTU + return defaults.GetDefaults().DefaultIfMTU } // Gets the maximum supported TUN/TAP interface MTU for your platform. This // can be as high as 65535, depending on platform, but is never lower than 1280. func (c *Core) GetTUNMaximumIfMTU() int { - return getDefaults().maximumIfMTU + return defaults.GetDefaults().MaximumIfMTU } // Gets the default TUN/TAP interface mode for your platform. func (c *Core) GetTUNDefaultIfTAPMode() bool { - return getDefaults().defaultIfTAPMode + return defaults.GetDefaults().DefaultIfTAPMode } // Gets the current TUN/TAP interface name. diff --git a/src/yggdrasil/defaults/defaults.go b/src/yggdrasil/defaults/defaults.go new file mode 100644 index 00000000..6145539c --- /dev/null +++ b/src/yggdrasil/defaults/defaults.go @@ -0,0 +1,15 @@ +package defaults + +// Defines which parameters are expected by default for configuration on a +// specific platform. These values are populated in the relevant defaults_*.go +// for the platform being targeted. They must be set. +type platformDefaultParameters struct { + // Admin socket + DefaultAdminListen string + + // TUN/TAP + MaximumIfMTU int + DefaultIfMTU int + DefaultIfName string + DefaultIfTAPMode bool +} diff --git a/src/yggdrasil/defaults/defaults_darwin.go b/src/yggdrasil/defaults/defaults_darwin.go new file mode 100644 index 00000000..b82660fa --- /dev/null +++ b/src/yggdrasil/defaults/defaults_darwin.go @@ -0,0 +1,18 @@ +// +build darwin + +package defaults + +// Sane defaults for the macOS/Darwin platform. The "default" options may be +// may be replaced by the running configuration. +func GetDefaults() platformDefaultParameters { + return platformDefaultParameters{ + // Admin + DefaultAdminListen: "unix:///var/run/yggdrasil.sock", + + // TUN/TAP + MaximumIfMTU: 65535, + DefaultIfMTU: 65535, + DefaultIfName: "auto", + DefaultIfTAPMode: false, + } +} diff --git a/src/yggdrasil/defaults/defaults_freebsd.go b/src/yggdrasil/defaults/defaults_freebsd.go new file mode 100644 index 00000000..4ba7face --- /dev/null +++ b/src/yggdrasil/defaults/defaults_freebsd.go @@ -0,0 +1,18 @@ +// +build freebsd + +package defaults + +// Sane defaults for the BSD platforms. The "default" options may be +// may be replaced by the running configuration. +func GetDefaults() platformDefaultParameters { + return platformDefaultParameters{ + // Admin + DefaultAdminListen: "unix:///var/run/yggdrasil.sock", + + // TUN/TAP + MaximumIfMTU: 32767, + DefaultIfMTU: 32767, + DefaultIfName: "/dev/tap0", + DefaultIfTAPMode: true, + } +} diff --git a/src/yggdrasil/defaults/defaults_linux.go b/src/yggdrasil/defaults/defaults_linux.go new file mode 100644 index 00000000..4572f3c1 --- /dev/null +++ b/src/yggdrasil/defaults/defaults_linux.go @@ -0,0 +1,18 @@ +// +build linux + +package defaults + +// Sane defaults for the Linux platform. The "default" options may be +// may be replaced by the running configuration. +func GetDefaults() platformDefaultParameters { + return platformDefaultParameters{ + // Admin + DefaultAdminListen: "unix:///var/run/yggdrasil.sock", + + // TUN/TAP + MaximumIfMTU: 65535, + DefaultIfMTU: 65535, + DefaultIfName: "auto", + DefaultIfTAPMode: false, + } +} diff --git a/src/yggdrasil/defaults/defaults_netbsd.go b/src/yggdrasil/defaults/defaults_netbsd.go new file mode 100644 index 00000000..d9f3b4d3 --- /dev/null +++ b/src/yggdrasil/defaults/defaults_netbsd.go @@ -0,0 +1,18 @@ +// +build freebsd + +package defaults + +// Sane defaults for the BSD platforms. The "default" options may be +// may be replaced by the running configuration. +func GetDefaults() platformDefaultParameters { + return platformDefaultParameters{ + // Admin + DefaultAdminListen: "unix:///var/run/yggdrasil.sock", + + // TUN/TAP + MaximumIfMTU: 9000, + DefaultIfMTU: 9000, + DefaultIfName: "/dev/tap0", + DefaultIfTAPMode: true, + } +} diff --git a/src/yggdrasil/defaults/defaults_openbsd.go b/src/yggdrasil/defaults/defaults_openbsd.go new file mode 100644 index 00000000..1b3e0c07 --- /dev/null +++ b/src/yggdrasil/defaults/defaults_openbsd.go @@ -0,0 +1,18 @@ +// +build freebsd + +package defaults + +// Sane defaults for the BSD platforms. The "default" options may be +// may be replaced by the running configuration. +func GetDefaults() platformDefaultParameters { + return platformDefaultParameters{ + // Admin + DefaultAdminListen: "unix:///var/run/yggdrasil.sock", + + // TUN/TAP + MaximumIfMTU: 16384, + DefaultIfMTU: 16384, + DefaultIfName: "/dev/tap0", + DefaultIfTAPMode: true, + } +} diff --git a/src/yggdrasil/defaults/defaults_other.go b/src/yggdrasil/defaults/defaults_other.go new file mode 100644 index 00000000..29e71e84 --- /dev/null +++ b/src/yggdrasil/defaults/defaults_other.go @@ -0,0 +1,18 @@ +// +build !linux,!darwin,!windows,!openbsd,!freebsd,!netbsd + +package defaults + +// Sane defaults for the other platforms. The "default" options may be +// may be replaced by the running configuration. +func GetDefaults() platformDefaultParameters { + return platformDefaultParameters{ + // Admin + DefaultAdminListen: "tcp://localhost:9001", + + // TUN/TAP + MaximumIfMTU: 65535, + DefaultIfMTU: 65535, + DefaultIfName: "none", + DefaultIfTAPMode: false, + } +} diff --git a/src/yggdrasil/defaults/defaults_windows.go b/src/yggdrasil/defaults/defaults_windows.go new file mode 100644 index 00000000..91e9e0e5 --- /dev/null +++ b/src/yggdrasil/defaults/defaults_windows.go @@ -0,0 +1,18 @@ +// +build windows + +package defaults + +// Sane defaults for the Windows platform. The "default" options may be +// may be replaced by the running configuration. +func GetDefaults() platformDefaultParameters { + return platformDefaultParameters{ + // Admin + DefaultAdminListen: "tcp://localhost:9001", + + // TUN/TAP + MaximumIfMTU: 65535, + DefaultIfMTU: 65535, + DefaultIfName: "auto", + DefaultIfTAPMode: true, + } +} diff --git a/src/yggdrasil/tun.go b/src/yggdrasil/tun.go index 94adbcb4..cbbcdea7 100644 --- a/src/yggdrasil/tun.go +++ b/src/yggdrasil/tun.go @@ -3,6 +3,8 @@ package yggdrasil // This manages the tun driver to send/recv packets to/from applications import ( + "yggdrasil/defaults" + "github.com/songgao/packets/ethernet" "github.com/yggdrasil-network/water" ) @@ -20,21 +22,11 @@ type tunDevice struct { iface *water.Interface } -// Defines which parameters are expected by default for a TUN/TAP adapter on a -// specific platform. These values are populated in the relevant tun_*.go for -// the platform being targeted. They must be set. -type tunDefaultParameters struct { - maximumIfMTU int - defaultIfMTU int - defaultIfName string - defaultIfTAPMode bool -} - // Gets the maximum supported MTU for the platform based on the defaults in -// getDefaults(). +// defaults.GetDefaults(). func getSupportedMTU(mtu int) int { - if mtu > getDefaults().maximumIfMTU { - return getDefaults().maximumIfMTU + if mtu > defaults.GetDefaults().MaximumIfMTU { + return defaults.GetDefaults().MaximumIfMTU } return mtu } diff --git a/src/yggdrasil/tun_darwin.go b/src/yggdrasil/tun_darwin.go index ff85aa40..e49ab528 100644 --- a/src/yggdrasil/tun_darwin.go +++ b/src/yggdrasil/tun_darwin.go @@ -13,17 +13,6 @@ import ( water "github.com/yggdrasil-network/water" ) -// Sane defaults for the Darwin/macOS platform. The "default" options may be -// may be replaced by the running configuration. -func getDefaults() tunDefaultParameters { - return tunDefaultParameters{ - maximumIfMTU: 65535, - defaultIfMTU: 65535, - defaultIfName: "auto", - defaultIfTAPMode: false, - } -} - // Configures the "utun" adapter with the correct IPv6 address and MTU. func (tun *tunDevice) setup(ifname string, iftapmode bool, addr string, mtu int) error { if iftapmode { diff --git a/src/yggdrasil/tun_freebsd.go b/src/yggdrasil/tun_freebsd.go deleted file mode 100644 index 4cfdcee1..00000000 --- a/src/yggdrasil/tun_freebsd.go +++ /dev/null @@ -1,12 +0,0 @@ -package yggdrasil - -// Sane defaults for the FreeBSD platform. The "default" options may be -// may be replaced by the running configuration. -func getDefaults() tunDefaultParameters { - return tunDefaultParameters{ - maximumIfMTU: 32767, - defaultIfMTU: 32767, - defaultIfName: "/dev/tap0", - defaultIfTAPMode: true, - } -} diff --git a/src/yggdrasil/tun_linux.go b/src/yggdrasil/tun_linux.go index 977d73d0..24c5aa92 100644 --- a/src/yggdrasil/tun_linux.go +++ b/src/yggdrasil/tun_linux.go @@ -12,17 +12,6 @@ import ( water "github.com/yggdrasil-network/water" ) -// Sane defaults for the Linux platform. The "default" options may be -// may be replaced by the running configuration. -func getDefaults() tunDefaultParameters { - return tunDefaultParameters{ - maximumIfMTU: 65535, - defaultIfMTU: 65535, - defaultIfName: "auto", - defaultIfTAPMode: false, - } -} - // Configures the TAP adapter with the correct IPv6 address and MTU. func (tun *tunDevice) setup(ifname string, iftapmode bool, addr string, mtu int) error { var config water.Config diff --git a/src/yggdrasil/tun_netbsd.go b/src/yggdrasil/tun_netbsd.go deleted file mode 100644 index d3e93c4d..00000000 --- a/src/yggdrasil/tun_netbsd.go +++ /dev/null @@ -1,12 +0,0 @@ -package yggdrasil - -// Sane defaults for the NetBSD platform. The "default" options may be -// may be replaced by the running configuration. -func getDefaults() tunDefaultParameters { - return tunDefaultParameters{ - maximumIfMTU: 9000, - defaultIfMTU: 9000, - defaultIfName: "/dev/tap0", - defaultIfTAPMode: true, - } -} diff --git a/src/yggdrasil/tun_openbsd.go b/src/yggdrasil/tun_openbsd.go deleted file mode 100644 index c96c8658..00000000 --- a/src/yggdrasil/tun_openbsd.go +++ /dev/null @@ -1,12 +0,0 @@ -package yggdrasil - -// Sane defaults for the OpenBSD platform. The "default" options may be -// may be replaced by the running configuration. -func getDefaults() tunDefaultParameters { - return tunDefaultParameters{ - maximumIfMTU: 16384, - defaultIfMTU: 16384, - defaultIfName: "/dev/tap0", - defaultIfTAPMode: true, - } -} diff --git a/src/yggdrasil/tun_other.go b/src/yggdrasil/tun_other.go index 7bc7100c..1a3721ac 100644 --- a/src/yggdrasil/tun_other.go +++ b/src/yggdrasil/tun_other.go @@ -7,17 +7,6 @@ import water "github.com/yggdrasil-network/water" // This is to catch unsupported platforms // If your platform supports tun devices, you could try configuring it manually -// These are sane defaults for any platform that has not been matched by one of -// the other tun_*.go files. -func getDefaults() tunDefaultParameters { - return tunDefaultParameters{ - maximumIfMTU: 65535, - defaultIfMTU: 65535, - defaultIfName: "none", - defaultIfTAPMode: false, - } -} - // Creates the TUN/TAP adapter, if supported by the Water library. Note that // no guarantees are made at this point on an unsupported platform. func (tun *tunDevice) setup(ifname string, iftapmode bool, addr string, mtu int) error { diff --git a/src/yggdrasil/tun_windows.go b/src/yggdrasil/tun_windows.go index 131bb344..c6e57705 100644 --- a/src/yggdrasil/tun_windows.go +++ b/src/yggdrasil/tun_windows.go @@ -10,17 +10,6 @@ import ( // This is to catch Windows platforms -// Sane defaults for the Windows platform. The "default" options may be -// may be replaced by the running configuration. -func getDefaults() tunDefaultParameters { - return tunDefaultParameters{ - maximumIfMTU: 65535, - defaultIfMTU: 65535, - defaultIfName: "auto", - defaultIfTAPMode: true, - } -} - // Configures the TAP adapter with the correct IPv6 address and MTU. On Windows // we don't make use of a direct operating system API to do this - we instead // delegate the hard work to "netsh". diff --git a/yggdrasil.go b/yggdrasil.go index 20b4aa08..ab237f4c 100644 --- a/yggdrasil.go +++ b/yggdrasil.go @@ -23,6 +23,7 @@ import ( "yggdrasil" "yggdrasil/config" + "yggdrasil/defaults" ) type nodeConfig = config.NodeConfig @@ -53,7 +54,7 @@ func generateConfig(isAutoconf bool) *nodeConfig { r1 := rand.New(rand.NewSource(time.Now().UnixNano())) cfg.Listen = fmt.Sprintf("[::]:%d", r1.Intn(65534-32768)+32768) } - cfg.AdminListen = "localhost:9001" + cfg.AdminListen = defaults.GetDefaults().DefaultAdminListen cfg.EncryptionPublicKey = hex.EncodeToString(bpub[:]) cfg.EncryptionPrivateKey = hex.EncodeToString(bpriv[:]) cfg.SigningPublicKey = hex.EncodeToString(spub[:]) @@ -61,9 +62,9 @@ func generateConfig(isAutoconf bool) *nodeConfig { cfg.Peers = []string{} cfg.AllowedEncryptionPublicKeys = []string{} cfg.MulticastInterfaces = []string{".*"} - cfg.IfName = core.GetTUNDefaultIfName() - cfg.IfMTU = core.GetTUNDefaultIfMTU() - cfg.IfTAPMode = core.GetTUNDefaultIfTAPMode() + cfg.IfName = defaults.GetDefaults().DefaultIfName + cfg.IfMTU = defaults.GetDefaults().DefaultIfMTU + cfg.IfTAPMode = defaults.GetDefaults().DefaultIfTAPMode return &cfg } diff --git a/yggdrasilctl.go b/yggdrasilctl.go index 5cea7745..c4efe773 100644 --- a/yggdrasilctl.go +++ b/yggdrasilctl.go @@ -9,10 +9,12 @@ import "encoding/json" import "strconv" import "os" +import "yggdrasil/defaults" + type admin_info map[string]interface{} func main() { - server := flag.String("endpoint", "localhost:9001", "Admin socket endpoint") + server := flag.String("endpoint", defaults.GetDefaults().DefaultAdminListen, "Admin socket endpoint") injson := flag.Bool("json", false, "Output in JSON format") flag.Parse() args := flag.Args() From 36c89da848adb164d01da5b7ca78c34972b8f590 Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Sat, 7 Jul 2018 12:16:55 +0100 Subject: [PATCH 2/3] Stick with tcp://localhost:9001 as default for now --- src/yggdrasil/config/config.go | 2 +- src/yggdrasil/defaults/defaults_darwin.go | 2 +- src/yggdrasil/defaults/defaults_freebsd.go | 2 +- src/yggdrasil/defaults/defaults_linux.go | 2 +- src/yggdrasil/defaults/defaults_netbsd.go | 2 +- src/yggdrasil/defaults/defaults_openbsd.go | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/yggdrasil/config/config.go b/src/yggdrasil/config/config.go index 2b8fbe3b..5b03e237 100644 --- a/src/yggdrasil/config/config.go +++ b/src/yggdrasil/config/config.go @@ -3,7 +3,7 @@ package config // NodeConfig defines all configuration values needed to run a signle yggdrasil node type NodeConfig struct { Listen string `comment:"Listen address for peer connections. Default is to listen for all\nTCP connections over IPv4 and IPv6 with a random port."` - AdminListen string `comment:"Listen address for admin connections Default is to listen for local\nconnections only on TCP port 9001."` + AdminListen string `comment:"Listen address for admin connections Default is to listen for local\nconnections either on TCP/9001 or a UNIX socket depending on your\nplatform. Use this value for yggdrasilctl -endpoint=X."` Peers []string `comment:"List of connection strings for static peers in URI format, i.e.\ntcp://a.b.c.d:e or socks://a.b.c.d:e/f.g.h.i:j"` AllowedEncryptionPublicKeys []string `comment:"List of peer encryption public keys to allow or incoming TCP\nconnections from. If left empty/undefined then all connections\nwill be allowed by default."` EncryptionPublicKey string `comment:"Your public encryption key. Your peers may ask you for this to put\ninto their AllowedEncryptionPublicKeys configuration."` diff --git a/src/yggdrasil/defaults/defaults_darwin.go b/src/yggdrasil/defaults/defaults_darwin.go index b82660fa..3a88274d 100644 --- a/src/yggdrasil/defaults/defaults_darwin.go +++ b/src/yggdrasil/defaults/defaults_darwin.go @@ -7,7 +7,7 @@ package defaults func GetDefaults() platformDefaultParameters { return platformDefaultParameters{ // Admin - DefaultAdminListen: "unix:///var/run/yggdrasil.sock", + DefaultAdminListen: "tcp://localhost:9001", // TUN/TAP MaximumIfMTU: 65535, diff --git a/src/yggdrasil/defaults/defaults_freebsd.go b/src/yggdrasil/defaults/defaults_freebsd.go index 4ba7face..7c5c7752 100644 --- a/src/yggdrasil/defaults/defaults_freebsd.go +++ b/src/yggdrasil/defaults/defaults_freebsd.go @@ -7,7 +7,7 @@ package defaults func GetDefaults() platformDefaultParameters { return platformDefaultParameters{ // Admin - DefaultAdminListen: "unix:///var/run/yggdrasil.sock", + DefaultAdminListen: "tcp://localhost:9001", // TUN/TAP MaximumIfMTU: 32767, diff --git a/src/yggdrasil/defaults/defaults_linux.go b/src/yggdrasil/defaults/defaults_linux.go index 4572f3c1..2c54d0fc 100644 --- a/src/yggdrasil/defaults/defaults_linux.go +++ b/src/yggdrasil/defaults/defaults_linux.go @@ -7,7 +7,7 @@ package defaults func GetDefaults() platformDefaultParameters { return platformDefaultParameters{ // Admin - DefaultAdminListen: "unix:///var/run/yggdrasil.sock", + DefaultAdminListen: "tcp://localhost:9001", // TUN/TAP MaximumIfMTU: 65535, diff --git a/src/yggdrasil/defaults/defaults_netbsd.go b/src/yggdrasil/defaults/defaults_netbsd.go index d9f3b4d3..64dd5b05 100644 --- a/src/yggdrasil/defaults/defaults_netbsd.go +++ b/src/yggdrasil/defaults/defaults_netbsd.go @@ -7,7 +7,7 @@ package defaults func GetDefaults() platformDefaultParameters { return platformDefaultParameters{ // Admin - DefaultAdminListen: "unix:///var/run/yggdrasil.sock", + DefaultAdminListen: "tcp://localhost:9001", // TUN/TAP MaximumIfMTU: 9000, diff --git a/src/yggdrasil/defaults/defaults_openbsd.go b/src/yggdrasil/defaults/defaults_openbsd.go index 1b3e0c07..1e9e28c2 100644 --- a/src/yggdrasil/defaults/defaults_openbsd.go +++ b/src/yggdrasil/defaults/defaults_openbsd.go @@ -7,7 +7,7 @@ package defaults func GetDefaults() platformDefaultParameters { return platformDefaultParameters{ // Admin - DefaultAdminListen: "unix:///var/run/yggdrasil.sock", + DefaultAdminListen: "tcp://localhost:9001", // TUN/TAP MaximumIfMTU: 16384, From 14d48597da41bc73510140c34eeaba38750793b0 Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Sat, 7 Jul 2018 12:18:03 +0100 Subject: [PATCH 3/3] Fix openbsd and netbsd --- src/yggdrasil/defaults/defaults_netbsd.go | 2 +- src/yggdrasil/defaults/defaults_openbsd.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/yggdrasil/defaults/defaults_netbsd.go b/src/yggdrasil/defaults/defaults_netbsd.go index 64dd5b05..8e8f7b5f 100644 --- a/src/yggdrasil/defaults/defaults_netbsd.go +++ b/src/yggdrasil/defaults/defaults_netbsd.go @@ -1,4 +1,4 @@ -// +build freebsd +// +build netbsd package defaults diff --git a/src/yggdrasil/defaults/defaults_openbsd.go b/src/yggdrasil/defaults/defaults_openbsd.go index 1e9e28c2..8b3e2bbc 100644 --- a/src/yggdrasil/defaults/defaults_openbsd.go +++ b/src/yggdrasil/defaults/defaults_openbsd.go @@ -1,4 +1,4 @@ -// +build freebsd +// +build openbsd package defaults