feature/conn25: guard against an index out of bounds panic (#19066)
Updates #cleanup Signed-off-by: Andrew Lytvynov <awly@tailscale.com>
This commit is contained in:
@@ -534,6 +534,9 @@ func (c *client) reserveAddresses(domain dnsname.FQDN, dst netip.Addr) (addrs, e
|
|||||||
return existing, nil
|
return existing, nil
|
||||||
}
|
}
|
||||||
appNames, _ := c.config.appNamesByDomain[domain]
|
appNames, _ := c.config.appNamesByDomain[domain]
|
||||||
|
if len(appNames) == 0 {
|
||||||
|
return addrs{}, fmt.Errorf("no app names found for domain %q", domain)
|
||||||
|
}
|
||||||
// only reserve for first app
|
// only reserve for first app
|
||||||
app := appNames[0]
|
app := appNames[0]
|
||||||
mip, err := c.magicIPPool.next()
|
mip, err := c.magicIPPool.next()
|
||||||
|
|||||||
Reference in New Issue
Block a user