Bug 1259842: allow RFC1918 pairing again r=mjf a=lizzard
authorNils Ohlmeier [:drno] <drno@ohlmeier.org>
Tue, 19 Apr 2016 17:03:49 -0700
changeset 324008 9dec4e0f5080d9a614a427697e17dcd7515147d4
parent 324007 5b11886851efd1ab4e012508f6b7151dc71972f6
child 324009 75d615fb8e1db3d263427b6684bf95fb8c17ed12
push id5913
push userjlund@mozilla.com
push dateMon, 25 Apr 2016 16:57:49 +0000
treeherdermozilla-beta@dcaf0a6fa115 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmjf, lizzard
bugs1259842
milestone47.0a2
Bug 1259842: allow RFC1918 pairing again r=mjf a=lizzard
media/mtransport/test/ice_unittest.cpp
media/mtransport/third_party/nICEr/src/ice/ice_component.c
--- a/media/mtransport/test/ice_unittest.cpp
+++ b/media/mtransport/test/ice_unittest.cpp
@@ -3037,17 +3037,19 @@ TEST_F(WebRtcIceConnectTest, TestPollCan
 
   r = p2_->GetCandidatePairs(0, &pairs);
   ASSERT_EQ(NS_OK, r);
   ASSERT_NE(0U, pairs.size());
   ASSERT_TRUE(p2_->CandidatePairsPriorityDescending(pairs));
   ASSERT_TRUE(ContainsSucceededPair(pairs));
 }
 
-TEST_F(WebRtcIceConnectTest, TestHostCandPairingFilter) {
+// TODO Bug 1259842 - disabled until we find a better way to handle two
+// candidates from different RFC1918 ranges
+TEST_F(WebRtcIceConnectTest, DISABLED_TestHostCandPairingFilter) {
   AddStream("first", 1);
   ASSERT_TRUE(Gather(kDefaultTimeout, false));
   SetCandidateFilter(IsIpv4Candidate);
 
   int host_net = p1_->GetCandidatesPrivateIpv4Range(0);
   if (host_net <= 0) {
     // TODO bug 1226838: make this work with multiple private IPs
     FAIL() << "This test needs exactly one private IPv4 host candidate to work" << std::endl;
--- a/media/mtransport/third_party/nICEr/src/ice/ice_component.c
+++ b/media/mtransport/third_party/nICEr/src/ice/ice_component.c
@@ -982,36 +982,31 @@ int nr_ice_component_can_candidate_tcpty
     if (left == TCP_TYPE_SO && right != TCP_TYPE_SO)
       return(0);
     if (left == TCP_TYPE_PASSIVE)
       return(0);
 
     return(1);
   }
 
-/* local vs. remote matters here because we allow private -> public pairing,
- * but discourage public -> private pairing. */
+/* filter out pairings which won't work. */
 int nr_ice_component_can_candidate_addr_pair(nr_transport_addr *local, nr_transport_addr *remote)
   {
     int remote_range;
 
     if(local->ip_version != remote->ip_version)
       return(0);
     if(nr_transport_addr_is_link_local(local) !=
        nr_transport_addr_is_link_local(remote))
       return(0);
     /* This prevents our ice_unittest (or broken clients) from pairing a
      * loopback with a host candidate. */
     if(nr_transport_addr_is_loopback(local) !=
        nr_transport_addr_is_loopback(remote))
       return(0);
-    remote_range = nr_transport_addr_get_private_addr_range(remote);
-    if(remote_range && (nr_transport_addr_get_private_addr_range(local) !=
-       remote_range))
-      return(0);
 
     return(1);
   }
 
 int nr_ice_component_pair_candidate(nr_ice_peer_ctx *pctx, nr_ice_component *pcomp, nr_ice_candidate *lcand, int pair_all_remote)
   {
     int r, _status;
     nr_ice_candidate *pcand;