From 68681962591c636f840e88b4e25585d26c4aa35b Mon Sep 17 00:00:00 2001 From: Dan Minor Date: Wed, 12 Jun 2019 17:21:15 +0000 Subject: [PATCH] Bug 1558524 - Fix handling of incoming mDNS candidates; r=bwc This must have been broken while addressing review comments in Bug 1548841, the first commit has it right and the last commit in the series breaks it. Since we don't yet generate mDNS addresses in Firefox, the unit tests would not catch this problem, and interoperability with other browsers would continue to work due to peer reflex candidates. We will have test coverage for this once we land generating our own mDNS candidates. ICE will fail in the mochitests if we don't support resolving mDNS addresses properly, which is how I discovered this bug. Differential Revision: https://phabricator.services.mozilla.com/D34579 --- .../signaling/src/peerconnection/MediaTransportHandler.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/media/webrtc/signaling/src/peerconnection/MediaTransportHandler.cpp b/media/webrtc/signaling/src/peerconnection/MediaTransportHandler.cpp index 3a48d3b177668..996fc3de60975 100644 --- a/media/webrtc/signaling/src/peerconnection/MediaTransportHandler.cpp +++ b/media/webrtc/signaling/src/peerconnection/MediaTransportHandler.cpp @@ -1392,6 +1392,7 @@ nsresult MediaTransportHandlerSTS::DNSListener::OnLookupComplete( mTransportId.c_str(), mCandidate.c_str(), buf); // Replace obfuscated address with actual address + std::string obfuscatedAddr = mTokenizedCandidate[4]; mTokenizedCandidate[4] = buf; std::ostringstream o; for (size_t i = 0; i < mTokenizedCandidate.size(); ++i) { @@ -1412,7 +1413,8 @@ nsresult MediaTransportHandlerSTS::DNSListener::OnLookupComplete( return NS_OK; } - nsresult rv = stream->ParseTrickleCandidate(mCandidate, mUfrag, ""); + nsresult rv = stream->ParseTrickleCandidate(mungedCandidate, mUfrag, + obfuscatedAddr); if (NS_FAILED(rv)) { CSFLogError(LOGTAG, "Couldn't process ICE candidate with transport id %s: "