diff options
| author | Claus Lensbøl <claus@tailscale.com> | 2026-01-15 09:04:20 -0500 |
|---|---|---|
| committer | Claus Lensbøl <claus@tailscale.com> | 2026-01-27 16:46:38 -0500 |
| commit | da28a92b22108aa366af4485c835b8feb11c4c03 (patch) | |
| tree | 3a390f29614e39f33169bfa103f4b1cd532b9d85 /feature/portmapper/portmapper.go | |
| parent | 8c17d871b33ade8ebf8e2a6c5e136f06c4019cd2 (diff) | |
| download | tailscale-cmol/run_portmapper_in_exec_queue.tar.xz tailscale-cmol/run_portmapper_in_exec_queue.zip | |
net/portmapper: put mappings and releases into an execqueuecmol/run_portmapper_in_exec_queue
We had an issue where releasing mappings would cause a deadlock when the
UPnP gateway did not respond. Instead of working on mappings sync, put
it into an exec queue and add a timeout on releasing the mappings.
Updates tailscale/corp#33888
Updates tailscale/corp#33619
Signed-off-by: Claus Lensbøl <claus@tailscale.com>
Diffstat (limited to 'feature/portmapper/portmapper.go')
| -rw-r--r-- | feature/portmapper/portmapper.go | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/feature/portmapper/portmapper.go b/feature/portmapper/portmapper.go index d1b903cb6..9c9d6acfc 100644 --- a/feature/portmapper/portmapper.go +++ b/feature/portmapper/portmapper.go @@ -6,6 +6,8 @@ package portmapper import ( + "context" + "tailscale.com/feature" "tailscale.com/net/netmon" "tailscale.com/net/portmapper" @@ -20,16 +22,18 @@ func init() { } func newPortMapper( + ctx context.Context, logf logger.Logf, bus *eventbus.Bus, netMon *netmon.Monitor, disableUPnPOrNil func() bool, - onlyTCP443OrNil func() bool) portmappertype.Client { - + onlyTCP443OrNil func() bool, +) portmappertype.Client { pm := portmapper.NewClient(portmapper.Config{ - EventBus: bus, - Logf: logf, - NetMon: netMon, + ShutdownCtx: ctx, + EventBus: bus, + Logf: logf, + NetMon: netMon, DebugKnobs: &portmapper.DebugKnobs{ DisableAll: onlyTCP443OrNil, DisableUPnPFunc: disableUPnPOrNil, |
