From b61799ecd8c1fbc7f9aaa8267b87eea84816e420 Mon Sep 17 00:00:00 2001 From: cnderrauber Date: Mon, 26 Jan 2026 14:37:02 +0800 Subject: [PATCH] Ignore parse addr error when add remote candidate (#4264) --- pkg/rtc/transport.go | 5 ++++- pkg/rtc/types/ice.go | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/pkg/rtc/transport.go b/pkg/rtc/transport.go index 66aa9b01c..1c0190702 100644 --- a/pkg/rtc/transport.go +++ b/pkg/rtc/transport.go @@ -2389,7 +2389,10 @@ func (t *PCTransport) handleRemoteICECandidate(e event) error { if err := t.pc.AddICECandidate(*c); err != nil { t.params.Logger.Warnw("failed to add ICE candidate", err, "candidate", c) - return errors.Wrap(err, "add ice candidate failed") + // ignore ParseAddr error as it does not affect ICE connectivity + if !strings.Contains(err.Error(), "ParseAddr") { + return errors.Wrap(err, "add ice candidate failed") + } } else { t.params.Logger.Debugw("added ICE candidate", "candidate", c) } diff --git a/pkg/rtc/types/ice.go b/pkg/rtc/types/ice.go index fbcbc5a40..9b6e36feb 100644 --- a/pkg/rtc/types/ice.go +++ b/pkg/rtc/types/ice.go @@ -446,5 +446,5 @@ func IsICECandidateMDNS(candidate ice.Candidate) bool { return false } - return strings.HasSuffix(candidate.Address(), ".local") + return strings.HasSuffix(candidate.Address(), ".local") || strings.HasSuffix(candidate.Address(), ".invalid") }