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:
Wade Simmons 2021-03-26 15:01:05 -04:00 committed by GitHub
parent a71541fb0b
commit 4603b5b2dd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -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 {