Skip to content

Commit

Permalink
address feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
JackDoanRivian committed Nov 11, 2024
1 parent 2d2fc05 commit e2da748
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lighthouse.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
}
Expand Down

0 comments on commit e2da748

Please sign in to comment.