From e2da748a08adb0f7046babac625c9500c62717c4 Mon Sep 17 00:00:00 2001 From: Jack Doan Date: Mon, 11 Nov 2024 10:01:44 -0500 Subject: [PATCH] address feedback --- lighthouse.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lighthouse.go b/lighthouse.go index e0d1c3dc9..06f070f43 100644 --- a/lighthouse.go +++ b/lighthouse.go @@ -1286,7 +1286,8 @@ func (lhh *LightHouseHandler) handleHostUpdateNotification(n *NebulaMeta, fromVp } else if useVersion == cert.Version2 { n.Details.VpnAddr = netAddrToProtoAddr(fromVpnAddrs[0]) } else { - panic("unsupported version") //todo need a test that proves we can never get here so we can remove this + lhh.l.WithField("useVersion", useVersion).Error("invalid protocol version") + return } ln, err := n.MarshalTo(lhh.pb) @@ -1300,7 +1301,9 @@ func (lhh *LightHouseHandler) handleHostUpdateNotification(n *NebulaMeta, fromVp } func (lhh *LightHouseHandler) handleHostPunchNotification(n *NebulaMeta, fromVpnAddrs []netip.Addr, w EncWriter) { - //TODO: this is kinda stupid (WHY?) + //It's possible the lighthouse is communicating with us using a non primary vpn addr, + //which means we need to compare all fromVpnAddrs against all configured lighthouse vpn addrs. + //maybe one day we'll have a better idea, if it matters. if !lhh.lh.IsAnyLighthouseAddr(fromVpnAddrs) { return }