From 7676030355387c5cc240cdccf02f3781958f7e00 Mon Sep 17 00:00:00 2001 From: Eduardo Sorribas Date: Mon, 19 Jan 2026 15:32:13 +0100 Subject: [PATCH] net/portmapper: Stop replacing the internal port with the upnp external port (#18349) net/portmapper: Stop replacing the internal port with the upnp external port This causes the UPnP mapping to break in the next recreation of the mapping. Fixes #18348 Signed-off-by: Eduardo Sorribas --- net/portmapper/upnp.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/portmapper/upnp.go b/net/portmapper/upnp.go index 34140e947..46d7ff702 100644 --- a/net/portmapper/upnp.go +++ b/net/portmapper/upnp.go @@ -574,7 +574,7 @@ func (c *Client) getUPnPPortMapping( c.mu.Lock() defer c.mu.Unlock() c.mapping = upnp - c.localPort = externalAddrPort.Port() + c.localPort = internal.Port() return upnp.external, true }