mirror of
https://github.com/slackhq/nebula.git
synced 2025-12-05 18:20:48 -08:00
Use generics for CIDRTrees to avoid casting issues (#1004)
This commit is contained in:
parent
a44e1b8b05
commit
5181cb0474
21 changed files with 264 additions and 247 deletions
|
|
@ -205,7 +205,7 @@ type HostInfo struct {
|
|||
localIndexId uint32
|
||||
vpnIp iputil.VpnIp
|
||||
recvError atomic.Uint32
|
||||
remoteCidr *cidr.Tree4
|
||||
remoteCidr *cidr.Tree4[struct{}]
|
||||
relayState RelayState
|
||||
|
||||
// HandshakePacket records the packets used to create this hostinfo
|
||||
|
|
@ -633,7 +633,7 @@ func (i *HostInfo) CreateRemoteCIDR(c *cert.NebulaCertificate) {
|
|||
return
|
||||
}
|
||||
|
||||
remoteCidr := cidr.NewTree4()
|
||||
remoteCidr := cidr.NewTree4[struct{}]()
|
||||
for _, ip := range c.Details.Ips {
|
||||
remoteCidr.AddCIDR(&net.IPNet{IP: ip.IP, Mask: net.IPMask{255, 255, 255, 255}}, struct{}{})
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue