diff --git a/src/yggdrasil/debug.go b/src/yggdrasil/debug.go index ead8918b..ca330c5a 100644 --- a/src/yggdrasil/debug.go +++ b/src/yggdrasil/debug.go @@ -269,8 +269,8 @@ func (c *Core) DEBUG_setupAndStartGlobalUDPInterface(addrport string) { c.udp = &iface } -func (c *Core) DEBUG_getGlobalUDPAddr() net.Addr { - return c.udp.sock.LocalAddr() +func (c *Core) DEBUG_getGlobalUDPAddr() *net.UDPAddr { + return c.udp.sock.LocalAddr().(*net.UDPAddr) } func (c *Core) DEBUG_maybeSendUDPKeys(saddr string) { diff --git a/yggdrasil.go b/yggdrasil.go index b59b3d41..fd579902 100644 --- a/yggdrasil.go +++ b/yggdrasil.go @@ -169,6 +169,8 @@ func (n *node) announce() { panic(err) } var anAddr net.UDPAddr + udpAddr := n.core.DEBUG_getGlobalUDPAddr() + anAddr.Port = udpAddr.Port destAddr, err := net.ResolveUDPAddr("udp6", multicastAddr) if err != nil { panic(err)