Selaa lähdekoodia

lib/connections: Fix WANAddresses returning only unspecified IPs (ref #9010) (#9073)

Avoids taking the address of the same variable twice.
Maximilian 2 vuotta sitten
vanhempi
sitoutus
c42c0e7ceb
1 muutettua tiedostoa jossa 3 lisäystä ja 3 poistoa
  1. 3 3
      lib/connections/tcp_listen.go

+ 3 - 3
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)
 			}
 		}
 	}