Sanitize candidates in ICE-level stats when necessary.
The address and the related address of local candidates are sanitized
accordingly when the mDNS concealment of local IPs is enabled. Also,
remote hostname candidates created from signaling are sanitized in stats
as well. A couple of unit tests are revised to reflect the desired
behavior of AsyncResolverInterface so that when a hostname candidate is
resolved, the hostname is kept in the candidate address.
Bug: webrtc:9605, chromium:914452
Change-Id: Iad9ad04ce4e50304e44cf04b15b97a7ae2dec960
Reviewed-on: https://webrtc-review.googlesource.com/c/113643
Reviewed-by: Qingsi Wang <qingsi@webrtc.org>
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Reviewed-by: Seth Hampson <shampson@webrtc.org>
Reviewed-by: Jeroen de Borst <jeroendb@webrtc.org>
Commit-Queue: Qingsi Wang <qingsi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25996}
diff --git a/pc/peerconnection.cc b/pc/peerconnection.cc
index 45e8c71..f24073d 100644
--- a/pc/peerconnection.cc
+++ b/pc/peerconnection.cc
@@ -6449,7 +6449,8 @@
kBestConnections_IPv6,
kPeerConnectionAddressFamilyCounter_Max);
} else {
- RTC_CHECK(0);
+ RTC_CHECK(!local.address().hostname().empty() &&
+ local.address().IsUnresolvedIP());
}
return;