appc: don't schedule advertisement of 0 routes

When the store-appc-routes flag is on for a tailnet we are writing the
routes more often than seems necessary. Investigation reveals that we
are doing so ~every time we observe a dns response, even if this causes
us not to advertise any new routes. So when we have no new routes,
instead do not advertise routes.

Fixes #12593

Signed-off-by: Fran Bull <fran@tailscale.com>
pull/12610/head
Fran Bull 5 months ago committed by franbull
parent 24a40f54d9
commit 7eb8a77ac8

@ -442,9 +442,11 @@ func (e *AppConnector) ObserveDNSResponse(res []byte) {
} }
} }
if len(toAdvertise) > 0 {
e.logf("[v2] observed new routes for %s: %s", domain, toAdvertise) e.logf("[v2] observed new routes for %s: %s", domain, toAdvertise)
e.scheduleAdvertisement(domain, toAdvertise...) e.scheduleAdvertisement(domain, toAdvertise...)
} }
}
} }
// starting from the given domain that resolved to an address, find it, or any // starting from the given domain that resolved to an address, find it, or any

Loading…
Cancel
Save