mirror of
https://github.com/tailscale/tailscale.git
synced 2026-02-27 18:42:30 +01:00
net/portmapper: add UPnP-IGD release timeout
Smallest possible change that could help mitigate a deadlock if a release is haning. Updates tailscale/corp#33619 Signed-off-by: Claus Lensbøl <claus@tailscale.com>
This commit is contained in:
parent
afaa23c3b4
commit
c686a9d6d0
@ -395,7 +395,9 @@ func (c *Client) listenPacket(ctx context.Context, network, addr string) (nettyp
|
||||
func (c *Client) invalidateMappingsLocked(releaseOld bool) {
|
||||
if c.mapping != nil {
|
||||
if releaseOld {
|
||||
c.mapping.Release(context.Background())
|
||||
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
|
||||
defer cancel()
|
||||
c.mapping.Release(ctx)
|
||||
}
|
||||
c.mapping = nil
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user