Merge pull request #1822 from safing/fix/spn_stickedHub_logical_issue

[fix] SPN - Improve sticky domain handling in getStickiedHub function
This commit is contained in:
Alexandr Stelnykovych
2025-03-17 16:15:45 +02:00
committed by GitHub

View File

@@ -71,7 +71,8 @@ func getStickiedHub(conn *network.Connection) (sticksTo *stickyHub) {
// If the IP did not stick and we have a domain, check if that sticks.
if sticksTo == nil && conn.Entity.Domain != "" {
sticksTo, ok := stickyDomains[makeStickyDomainKey(conn)]
var ok bool
sticksTo, ok = stickyDomains[makeStickyDomainKey(conn)]
if ok && !sticksTo.isExpired() {
sticksTo.LastSeen = time.Now()
}
@@ -146,6 +147,8 @@ func (t *Tunnel) avoidDestinationHub() {
Avoid: true,
}
log.Warningf("spn/crew: avoiding %s for %s", t.dstPin.Hub, ipKey)
// TODO: Question: Should we avoid the domain as well? (stickyDomains)
}
func cleanStickyHubs(ctx *mgr.WorkerCtx) error {