From 1155816df8d653bdcdb5388f766cf4c97fcdd193 Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Wed, 7 Mar 2018 09:41:04 +0000 Subject: [PATCH] Show both UDP and TCP listen addresses in stdout (#51) --- src/yggdrasil/tcp.go | 2 +- src/yggdrasil/udp.go | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/yggdrasil/tcp.go b/src/yggdrasil/tcp.go index 9e01dc6c..972d1ca3 100644 --- a/src/yggdrasil/tcp.go +++ b/src/yggdrasil/tcp.go @@ -51,7 +51,7 @@ func (iface *tcpInterface) init(core *Core, addr string) { func (iface *tcpInterface) listener() { defer iface.serv.Close() - iface.core.log.Println("Listening on:", iface.serv.Addr().String()) + iface.core.log.Println("Listening for TCP on:", iface.serv.Addr().String()) for { sock, err := iface.serv.AcceptTCP() if err != nil { diff --git a/src/yggdrasil/udp.go b/src/yggdrasil/udp.go index a2cf0af2..7ae8f5e3 100644 --- a/src/yggdrasil/udp.go +++ b/src/yggdrasil/udp.go @@ -265,6 +265,7 @@ func (iface *udpInterface) handlePacket(msg []byte, addr connAddr) { } func (iface *udpInterface) reader() { + iface.core.log.Println("Listening for UDP on:", iface.sock.LocalAddr().String()) bs := make([]byte, 65536) // This needs to be large enough for everything... for { n, udpAddr, err := iface.sock.ReadFromUDP(bs)