mirror of https://github.com/slackhq/nebula.git
fix PromoteEvery check (#424)
This check was accidentally typo'd in #396 from `%` to `&`. Restore the correct functionality here (we want to do the check every "PromoteEvery" count packets).
This commit is contained in:
parent
a71541fb0b
commit
4603b5b2dd
|
@ -476,7 +476,7 @@ func (i *HostInfo) TryPromoteBest(preferredRanges []*net.IPNet, ifce *Interface)
|
|||
return
|
||||
}
|
||||
|
||||
if atomic.AddUint32(&i.promoteCounter, 1)&PromoteEvery == 0 {
|
||||
if atomic.AddUint32(&i.promoteCounter, 1)%PromoteEvery == 0 {
|
||||
// return early if we are already on a preferred remote
|
||||
rIP := i.remote.IP
|
||||
for _, l := range preferredRanges {
|
||||
|
|
Loading…
Reference in New Issue