From c42c0e7ceb67d4c35d41ad359014fe3542f532f5 Mon Sep 17 00:00:00 2001 From: Maximilian Date: Sun, 3 Sep 2023 17:03:27 +0200 Subject: [PATCH] lib/connections: Fix WANAddresses returning only unspecified IPs (ref #9010) (#9073) Avoids taking the address of the same variable twice. --- lib/connections/tcp_listen.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/connections/tcp_listen.go b/lib/connections/tcp_listen.go index da0830d0f..242bcfeab 100644 --- a/lib/connections/tcp_listen.go +++ b/lib/connections/tcp_listen.go @@ -178,10 +178,10 @@ func (t *tcpListener) WANAddresses() []*url.URL { // For every address with a specified IP, add one without an IP, // just in case the specified IP is still internal (router behind DMZ). if len(addr.IP) != 0 && !addr.IP.IsUnspecified() { - uri = *t.uri + zeroUri := *t.uri addr.IP = nil - uri.Host = addr.String() - uris = append(uris, &uri) + zeroUri.Host = addr.String() + uris = append(uris, &zeroUri) } } }