aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbt90 <btom1990@googlemail.com>2023-09-06 14:36:00 +0200
committerGitHub <noreply@github.com>2023-09-06 14:36:00 +0200
commit06ac10ee372840508a03520c94835a582427732c (patch)
treece193e3e304775cc58ded5f8f466d58ffea4956d
parent7c0223bd06de866fbe10ea9e7a5326b1d20096bb (diff)
downloadsyncthing-06ac10ee372840508a03520c94835a582427732c.tar.gz
syncthing-06ac10ee372840508a03520c94835a582427732c.zip
cmd/stdiscosrv: Deduplicate addresses (fixes #8482) (#9080)
-rw-r--r--cmd/stdiscosrv/apisrv.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/cmd/stdiscosrv/apisrv.go b/cmd/stdiscosrv/apisrv.go
index 56806ffb2..0f39f5d1f 100644
--- a/cmd/stdiscosrv/apisrv.go
+++ b/cmd/stdiscosrv/apisrv.go
@@ -29,6 +29,7 @@ import (
"time"
"github.com/syncthing/syncthing/lib/protocol"
+ "github.com/syncthing/syncthing/lib/stringutil"
)
// announcement is the format received from and sent to clients
@@ -440,6 +441,9 @@ func fixupAddresses(remote *net.TCPAddr, addresses []string) []string {
fixed = append(fixed, uri.String())
}
+ // Remove duplicate addresses
+ fixed = stringutil.UniqueTrimmedStrings(fixed)
+
return fixed
}