From f0887783891e711a3de5fc050cb529b4e96fded8 Mon Sep 17 00:00:00 2001 From: fumiama Date: Thu, 30 Dec 2021 15:41:14 +0800 Subject: [PATCH] add some logs --- gold/link/listen.go | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/gold/link/listen.go b/gold/link/listen.go index 6e49e36..904ca69 100644 --- a/gold/link/listen.go +++ b/gold/link/listen.go @@ -74,10 +74,14 @@ func (m *Me) listen() (conn *net.UDPConn, err error) { } else { logrus.Infoln("[link] drop invalid packet") } - } else if p.Accept(packet.Dst) && p.allowtrans { - // 转发 - p.Write(&packet) - logrus.Infoln("[link] trans packet to", packet.Dst.String()+":"+strconv.Itoa(int(packet.DstPort))) + } else if p.Accept(packet.Dst) { + if p.allowtrans { + // 转发 + p.Write(&packet) + logrus.Infoln("[link] trans packet to", packet.Dst.String()+":"+strconv.Itoa(int(packet.DstPort))) + } else { + logrus.Warnln("[link] refused to trans packet to", packet.Dst.String()+":"+strconv.Itoa(int(packet.DstPort))) + } } } else { logrus.Warnln("[link] packet to", packet.Dst, "is refused")