diff --git a/lib/connections/tcp_listen.go b/lib/connections/tcp_listen.go index dfdf4ff2e..91908d08d 100644 --- a/lib/connections/tcp_listen.go +++ b/lib/connections/tcp_listen.go @@ -13,6 +13,7 @@ import ( "log/slog" "net" "net/url" + "slices" "sync" "time" @@ -185,9 +186,10 @@ func (t *tcpListener) WANAddresses() []*url.URL { t.mut.RUnlock() - // If we support ReusePort, add an unspecified zero port address, which will be resolved by the discovery server - // in hopes that TCP punch through works. - if dialer.SupportsReusePort { + // If we support ReusePort, and we are already announcing an unspecified + // address, add an unspecified zero port address, which will be resolved + // by the discovery server in hopes that TCP punch through works. + if dialer.SupportsReusePort && slices.ContainsFunc(uris, func(u *url.URL) bool { return u.Hostname() == "0.0.0.0" }) { uri := *t.uri uri.Host = "0.0.0.0:0" uris = append([]*url.URL{&uri}, uris...) diff --git a/lib/discover/global.go b/lib/discover/global.go index 850e38aa2..be70e1775 100644 --- a/lib/discover/global.go +++ b/lib/discover/global.go @@ -289,7 +289,6 @@ func (c *globalClient) sendAnnouncement(ctx context.Context, timer *time.Timer) resp.Body.Close() if resp.StatusCode < 200 || resp.StatusCode > 299 { - slog.DebugContext(ctx, "announce POST", "server", c.server, "status", resp.Status) c.setError(errors.New(resp.Status)) if h := resp.Header.Get("Retry-After"); h != "" {