Bug 1543429 - Part 1: Do not copy port 0 from previous bundle-only offer msection into an answer msection. r=mjf
authorByron Campen [:bwc] <docfaraday@gmail.com>
Tue, 16 Apr 2019 14:53:41 +0000
changeset 528705 3f0ddb7c06a5e75a0e0d418c6e231a2986e04da9
parent 528704 2eba01487cf4205cf740759ea7811112df9624b9
child 528706 2405024a9a22ae1f10ef7f825bf1b840201fccd1
push id11265
push userffxbld-merge
push dateMon, 13 May 2019 10:53:39 +0000
treeherdermozilla-beta@77e0fe8dbdd3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmjf
bugs1543429
milestone68.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1543429 - Part 1: Do not copy port 0 from previous bundle-only offer msection into an answer msection. r=mjf Differential Revision: https://phabricator.services.mozilla.com/D27087
media/webrtc/signaling/src/sdp/SdpHelper.cpp
--- a/media/webrtc/signaling/src/sdp/SdpHelper.cpp
+++ b/media/webrtc/signaling/src/sdp/SdpHelper.cpp
@@ -24,21 +24,25 @@ MOZ_MTLOG_MODULE("sdp")
     os << error;                     \
     mLastError = os.str();           \
     MOZ_MTLOG(ML_ERROR, mLastError); \
   } while (0);
 
 nsresult SdpHelper::CopyTransportParams(size_t numComponents,
                                         const SdpMediaSection& oldLocal,
                                         SdpMediaSection* newLocal) {
+  const SdpAttributeList& oldLocalAttrs = oldLocal.GetAttributeList();
   // Copy over m-section details
-  newLocal->SetPort(oldLocal.GetPort());
+  if (!oldLocalAttrs.HasAttribute(SdpAttribute::kBundleOnlyAttribute)) {
+    // Do not copy port 0 from an offer with a=bundle-only; this could cause
+    // an answer msection to be erroneously rejected.
+    newLocal->SetPort(oldLocal.GetPort());
+  }
   newLocal->GetConnection() = oldLocal.GetConnection();
 
-  const SdpAttributeList& oldLocalAttrs = oldLocal.GetAttributeList();
   SdpAttributeList& newLocalAttrs = newLocal->GetAttributeList();
 
   // Now we copy over attributes that won't be added by the usual logic
   if (oldLocalAttrs.HasAttribute(SdpAttribute::kCandidateAttribute) &&
       numComponents) {
     UniquePtr<SdpMultiStringAttribute> candidateAttrs(
         new SdpMultiStringAttribute(SdpAttribute::kCandidateAttribute));
     for (const std::string& candidate : oldLocalAttrs.GetCandidate()) {