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

Avoids taking the address of the same variable twice.
This commit is contained in:
Maximilian
2023-09-03 15:03:27 +00:00
committed by GitHub
parent 5118538179
commit c42c0e7ceb
+3 -3
View File
@@ -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)
}
}
}