|
@@ -17,12 +17,10 @@ import (
|
|
"github.com/slackhq/nebula/header"
|
|
"github.com/slackhq/nebula/header"
|
|
)
|
|
)
|
|
|
|
|
|
-// const ProbeLen = 100
|
|
|
|
const defaultPromoteEvery = 1000 // Count of packets sent before we try moving a tunnel to a preferred underlay ip address
|
|
const defaultPromoteEvery = 1000 // Count of packets sent before we try moving a tunnel to a preferred underlay ip address
|
|
const defaultReQueryEvery = 5000 // Count of packets sent before re-querying a hostinfo to the lighthouse
|
|
const defaultReQueryEvery = 5000 // Count of packets sent before re-querying a hostinfo to the lighthouse
|
|
const defaultReQueryWait = time.Minute // Minimum amount of seconds to wait before re-querying a hostinfo the lighthouse. Evaluated every ReQueryEvery
|
|
const defaultReQueryWait = time.Minute // Minimum amount of seconds to wait before re-querying a hostinfo the lighthouse. Evaluated every ReQueryEvery
|
|
const MaxRemotes = 10
|
|
const MaxRemotes = 10
|
|
-const maxRecvError = 4
|
|
|
|
|
|
|
|
// MaxHostInfosPerVpnIp is the max number of hostinfos we will track for a given vpn ip
|
|
// MaxHostInfosPerVpnIp is the max number of hostinfos we will track for a given vpn ip
|
|
// 5 allows for an initial handshake and each host pair re-handshaking twice
|
|
// 5 allows for an initial handshake and each host pair re-handshaking twice
|
|
@@ -225,8 +223,7 @@ type HostInfo struct {
|
|
// vpnAddrs is a list of vpn addresses assigned to this host that are within our own vpn networks
|
|
// vpnAddrs is a list of vpn addresses assigned to this host that are within our own vpn networks
|
|
// The host may have other vpn addresses that are outside our
|
|
// The host may have other vpn addresses that are outside our
|
|
// vpn networks but were removed because they are not usable
|
|
// vpn networks but were removed because they are not usable
|
|
- vpnAddrs []netip.Addr
|
|
|
|
- recvError atomic.Uint32
|
|
|
|
|
|
+ vpnAddrs []netip.Addr
|
|
|
|
|
|
// networks are both all vpn and unsafe networks assigned to this host
|
|
// networks are both all vpn and unsafe networks assigned to this host
|
|
networks *bart.Lite
|
|
networks *bart.Lite
|
|
@@ -733,13 +730,6 @@ func (i *HostInfo) SetRemoteIfPreferred(hm *HostMap, newRemote netip.AddrPort) b
|
|
return false
|
|
return false
|
|
}
|
|
}
|
|
|
|
|
|
-func (i *HostInfo) RecvErrorExceeded() bool {
|
|
|
|
- if i.recvError.Add(1) >= maxRecvError {
|
|
|
|
- return true
|
|
|
|
- }
|
|
|
|
- return true
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
func (i *HostInfo) buildNetworks(networks, unsafeNetworks []netip.Prefix) {
|
|
func (i *HostInfo) buildNetworks(networks, unsafeNetworks []netip.Prefix) {
|
|
if len(networks) == 1 && len(unsafeNetworks) == 0 {
|
|
if len(networks) == 1 && len(unsafeNetworks) == 0 {
|
|
// Simple case, no CIDRTree needed
|
|
// Simple case, no CIDRTree needed
|