mirror of
https://github.com/tailscale/tailscale.git
synced 2025-04-07 16:54:37 +00:00
control/controlclient: sanitize invalid DERPMap nil Region from control
Fixes #14752 Change-Id: If364603eefb9ac6dc5ec6df84a0d5e16c94dda8d Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
parent
82e41ddc42
commit
2c98c44d9a
@ -300,6 +300,15 @@ func (ms *mapSession) updateStateFromResponse(resp *tailcfg.MapResponse) {
|
||||
if dm := resp.DERPMap; dm != nil {
|
||||
ms.vlogf("netmap: new map contains DERP map")
|
||||
|
||||
// Guard against the control server accidentally sending
|
||||
// a nil region definition, which at least Headscale was
|
||||
// observed to send.
|
||||
for rid, r := range dm.Regions {
|
||||
if r == nil {
|
||||
delete(dm.Regions, rid)
|
||||
}
|
||||
}
|
||||
|
||||
// Zero-valued fields in a DERPMap mean that we're not changing
|
||||
// anything and are using the previous value(s).
|
||||
if ldm := ms.lastDERPMap; ldm != nil {
|
||||
|
Loading…
x
Reference in New Issue
Block a user