Bug 1186590 - Part 2 - Move hard-coded interface priority list into nrinterfaceprioritizer, and simplify some functions. r=drno
authorByron Campen [:bwc] <docfaraday@gmail.com>
Fri, 04 Sep 2015 15:25:37 -0500
changeset 262279 5745780785ddde0306567edbd11569e302d79a70
parent 262278 c197bcf7d9a5ca541f3e70e6dd5f770d24c2fad4
child 262280 0b07b414b0455bacb6202f9063a7d7e49649a936
push id64972
push usercbook@mozilla.com
push dateMon, 14 Sep 2015 09:59:40 +0000
treeherdermozilla-inbound@5745780785dd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdrno
bugs1186590
milestone43.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 1186590 - Part 2 - Move hard-coded interface priority list into nrinterfaceprioritizer, and simplify some functions. r=drno
media/mtransport/nricectx.cpp
media/mtransport/nricectx.h
media/mtransport/nrinterfaceprioritizer.cpp
media/mtransport/test/ice_unittest.cpp
media/mtransport/test/stunserver.cpp
media/mtransport/test/turn_unittest.cpp
media/mtransport/third_party/nICEr/src/net/transport_addr.c
media/mtransport/third_party/nICEr/src/net/transport_addr.h
media/webrtc/signaling/src/peerconnection/PeerConnectionMedia.cpp
--- a/media/mtransport/nricectx.cpp
+++ b/media/mtransport/nricectx.cpp
@@ -373,17 +373,16 @@ void NrIceCtx::trickle_cb(void *arg, nr_
   MOZ_MTLOG(ML_INFO, "NrIceCtx(" << ctx->name_ << "): trickling candidate "
             << candidate_str);
 
   s->SignalCandidate(s, candidate_str);
 }
 
 RefPtr<NrIceCtx> NrIceCtx::Create(const std::string& name,
                                   bool offerer,
-                                  bool set_interface_priorities,
                                   bool allow_loopback,
                                   bool tcp_enabled,
                                   bool allow_link_local,
                                   bool hide_non_default,
                                   Policy policy) {
    RefPtr<NrIceCtx> ctx = new NrIceCtx(name, offerer, policy);
 
   // Initialize the crypto callbacks and logging stuff
@@ -399,43 +398,16 @@ RefPtr<NrIceCtx> NrIceCtx::Create(const 
     NR_reg_set_uchar((char *)NR_ICE_REG_PREF_TYPE_PEER_RFLX, 110);
     NR_reg_set_uchar((char *)NR_ICE_REG_PREF_TYPE_HOST, 126);
     NR_reg_set_uchar((char *)NR_ICE_REG_PREF_TYPE_RELAYED, 5);
     NR_reg_set_uchar((char *)NR_ICE_REG_PREF_TYPE_SRV_RFLX_TCP, 99);
     NR_reg_set_uchar((char *)NR_ICE_REG_PREF_TYPE_PEER_RFLX_TCP, 109);
     NR_reg_set_uchar((char *)NR_ICE_REG_PREF_TYPE_HOST_TCP, 125);
     NR_reg_set_uchar((char *)NR_ICE_REG_PREF_TYPE_RELAYED_TCP, 0);
 
-    if (set_interface_priorities) {
-      NR_reg_set_uchar((char *)"ice.pref.interface.rl0", 255);
-      NR_reg_set_uchar((char *)"ice.pref.interface.wi0", 254);
-      NR_reg_set_uchar((char *)"ice.pref.interface.lo0", 253);
-      NR_reg_set_uchar((char *)"ice.pref.interface.en1", 252);
-      NR_reg_set_uchar((char *)"ice.pref.interface.en0", 251);
-      NR_reg_set_uchar((char *)"ice.pref.interface.eth0", 252);
-      NR_reg_set_uchar((char *)"ice.pref.interface.eth1", 251);
-      NR_reg_set_uchar((char *)"ice.pref.interface.eth2", 249);
-      NR_reg_set_uchar((char *)"ice.pref.interface.ppp", 250);
-      NR_reg_set_uchar((char *)"ice.pref.interface.ppp0", 249);
-      NR_reg_set_uchar((char *)"ice.pref.interface.en2", 248);
-      NR_reg_set_uchar((char *)"ice.pref.interface.en3", 247);
-      NR_reg_set_uchar((char *)"ice.pref.interface.em0", 251);
-      NR_reg_set_uchar((char *)"ice.pref.interface.em1", 252);
-      NR_reg_set_uchar((char *)"ice.pref.interface.vmnet0", 240);
-      NR_reg_set_uchar((char *)"ice.pref.interface.vmnet1", 241);
-      NR_reg_set_uchar((char *)"ice.pref.interface.vmnet3", 239);
-      NR_reg_set_uchar((char *)"ice.pref.interface.vmnet4", 238);
-      NR_reg_set_uchar((char *)"ice.pref.interface.vmnet5", 237);
-      NR_reg_set_uchar((char *)"ice.pref.interface.vmnet6", 236);
-      NR_reg_set_uchar((char *)"ice.pref.interface.vmnet7", 235);
-      NR_reg_set_uchar((char *)"ice.pref.interface.vmnet8", 234);
-      NR_reg_set_uchar((char *)"ice.pref.interface.virbr0", 233);
-      NR_reg_set_uchar((char *)"ice.pref.interface.wlan0", 232);
-    }
-
     int32_t stun_client_maximum_transmits = 7;
     int32_t ice_trickle_grace_period = 5000;
     int32_t ice_tcp_so_sock_count = 3;
     int32_t ice_tcp_listen_backlog = 10;
     nsAutoCString force_net_interface;
 #ifndef MOZILLA_XPCOMRT_API
     nsresult res;
     nsCOMPtr<nsIPrefService> prefs =
--- a/media/mtransport/nricectx.h
+++ b/media/mtransport/nricectx.h
@@ -211,17 +211,16 @@ class NrIceCtx {
   enum Policy { ICE_POLICY_NONE,
                 ICE_POLICY_RELAY,
                 ICE_POLICY_ALL
   };
 
   // TODO(ekr@rtfm.com): Too many bools here. Bug 1193437.
   static RefPtr<NrIceCtx> Create(const std::string& name,
                                  bool offerer,
-                                 bool set_interface_priorities = true,
                                  bool allow_loopback = false,
                                  bool tcp_enabled = true,
                                  bool allow_link_local = false,
                                  bool hide_non_default = false,
                                  Policy policy = ICE_POLICY_ALL);
 
   // Deinitialize all ICE global state. Used only for testing.
   static void internal_DeinitializeGlobal();
--- a/media/mtransport/nrinterfaceprioritizer.cpp
+++ b/media/mtransport/nrinterfaceprioritizer.cpp
@@ -1,39 +1,53 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
+#include <algorithm>
 #include <map>
 #include <set>
 #include <string>
+#include <vector>
 #include "logging.h"
 #include "nrinterfaceprioritizer.h"
 #include "nsCOMPtr.h"
 
 MOZ_MTLOG_MODULE("mtransport")
 
 namespace {
 
 class LocalAddress {
 public:
   LocalAddress()
-    : key_(),
+    : ifname_(),
+      addr_(),
+      key_(),
       is_vpn_(-1),
       estimated_speed_(-1),
       type_preference_(-1),
       ip_version_(-1) {}
 
   bool Init(const nr_local_addr& local_addr) {
+    ifname_ = local_addr.addr.ifname;
+
     char buf[MAXIFNAME + 41];
     int r = nr_transport_addr_fmt_ifname_addr_string(&local_addr.addr, buf, sizeof(buf));
     if (r) {
-      MOZ_MTLOG(ML_ERROR, "Error formatting interface address string.");
+      MOZ_MTLOG(ML_ERROR, "Error formatting interface key.");
       return false;
     }
     key_ = buf;
+
+    r = nr_transport_addr_get_addrstring(&local_addr.addr, buf, sizeof(buf));
+    if (r) {
+      MOZ_MTLOG(ML_ERROR, "Error formatting address string.");
+      return false;
+    }
+    addr_ = buf;
+
     is_vpn_ = (local_addr.interface.type & NR_INTERFACE_TYPE_VPN) != 0 ? 1 : 0;
     estimated_speed_ = local_addr.interface.estimated_speed;
     type_preference_ = GetNetworkTypePreference(local_addr.interface.type);
     ip_version_ = local_addr.addr.ip_version;
     return true;
   }
 
   bool operator<(const LocalAddress& rhs) const {
@@ -51,23 +65,38 @@ public:
       return is_vpn_ < rhs.is_vpn_;
     }
 
     // Compare estimated speed.
     if (estimated_speed_ != rhs.estimated_speed_) {
       return estimated_speed_ > rhs.estimated_speed_;
     }
 
+    // See if our hard-coded pref list helps us.
+    auto thisindex = std::find(interface_preference_list().begin(),
+                               interface_preference_list().end(),
+                               ifname_);
+    auto rhsindex = std::find(interface_preference_list().begin(),
+                              interface_preference_list().end(),
+                              rhs.ifname_);
+    if (thisindex != rhsindex) {
+      return thisindex < rhsindex;
+    }
+
     // Prefer IPV6 over IPV4
     if (ip_version_ != rhs.ip_version_) {
       return ip_version_ > rhs.ip_version_;
     }
 
-    // All things above are the same, we can at least sort with key.
-    return key_ < rhs.key_;
+    // Now we start getting into arbitrary stuff
+    if (ifname_ != rhs.ifname_) {
+      return ifname_ < rhs.ifname_;
+    }
+
+    return addr_ < rhs.addr_;
   }
 
   const std::string& GetKey() const {
     return key_;
   }
 
 private:
   // Getting the preference corresponding to a type. Getting lower number here
@@ -80,16 +109,56 @@ private:
       return 2;
     }
     if (type & NR_INTERFACE_TYPE_MOBILE) {
       return 3;
     }
     return 4;
   }
 
+  // TODO(bug 895790): Once we can get useful interface properties on Darwin,
+  // we should remove this stuff.
+  static const std::vector<std::string>& interface_preference_list()
+  {
+    static std::vector<std::string> list(build_interface_preference_list());
+    return list;
+  }
+
+  static std::vector<std::string> build_interface_preference_list()
+  {
+    std::vector<std::string> result;
+    result.push_back("rl0");
+    result.push_back("wi0");
+    result.push_back("en0");
+    result.push_back("en1");
+    result.push_back("en2");
+    result.push_back("en3");
+    result.push_back("eth0");
+    result.push_back("eth1");
+    result.push_back("eth2");
+    result.push_back("em1");
+    result.push_back("em0");
+    result.push_back("ppp");
+    result.push_back("ppp0");
+    result.push_back("vmnet1");
+    result.push_back("vmnet0");
+    result.push_back("vmnet3");
+    result.push_back("vmnet4");
+    result.push_back("vmnet5");
+    result.push_back("vmnet6");
+    result.push_back("vmnet7");
+    result.push_back("vmnet8");
+    result.push_back("virbr0");
+    result.push_back("wlan0");
+    result.push_back("lo0");
+    return result;
+  }
+
+  std::string ifname_;
+  std::string addr_;
   std::string key_;
   int is_vpn_;
   int estimated_speed_;
   int type_preference_;
   int ip_version_;
 };
 
 class InterfacePrioritizer {
--- a/media/mtransport/test/ice_unittest.cpp
+++ b/media/mtransport/test/ice_unittest.cpp
@@ -83,21 +83,20 @@ std::string g_turn_server;
 std::string g_turn_user;
 std::string g_turn_password;
 
 namespace {
 
 enum TrickleMode { TRICKLE_NONE, TRICKLE_SIMULATE, TRICKLE_REAL };
 
 const unsigned int ICE_TEST_PEER_OFFERER = (1 << 0);
-const unsigned int ICE_TEST_PEER_SET_PRIORITIES = (1 << 1);
-const unsigned int ICE_TEST_PEER_ALLOW_LOOPBACK = (1 << 2);
-const unsigned int ICE_TEST_PEER_ENABLED_TCP = (1 << 3);
-const unsigned int ICE_TEST_PEER_ALLOW_LINK_LOCAL = (1 << 4);
-const unsigned int ICE_TEST_PEER_HIDE_NON_DEFAULT = (1 << 5);
+const unsigned int ICE_TEST_PEER_ALLOW_LOOPBACK = (1 << 1);
+const unsigned int ICE_TEST_PEER_ENABLED_TCP = (1 << 2);
+const unsigned int ICE_TEST_PEER_ALLOW_LINK_LOCAL = (1 << 3);
+const unsigned int ICE_TEST_PEER_HIDE_NON_DEFAULT = (1 << 4);
 
 typedef std::string (*CandidateFilter)(const std::string& candidate);
 
 static std::string IsRelayCandidate(const std::string& candidate) {
   if (candidate.find("typ relay") != std::string::npos) {
     return candidate;
   }
   return std::string();
@@ -254,21 +253,21 @@ class SchedulableTrickleCandidate {
 
     DISALLOW_COPY_ASSIGN(SchedulableTrickleCandidate);
 };
 
 class IceTestPeer : public sigslot::has_slots<> {
  public:
   // TODO(ekr@rtfm.com): Convert to flags when NrIceCtx::Create() does.
   // Bug 1193437.
-  IceTestPeer(const std::string& name, bool offerer, bool set_priorities,
+  IceTestPeer(const std::string& name, bool offerer,
               bool allow_loopback = false, bool enable_tcp = true,
               bool allow_link_local = false, bool hide_non_default = false) :
       name_(name),
-      ice_ctx_(NrIceCtx::Create(name, offerer, set_priorities, allow_loopback,
+      ice_ctx_(NrIceCtx::Create(name, offerer, allow_loopback,
                                 enable_tcp, allow_link_local, hide_non_default)),
       streams_(),
       candidates_(),
       gathering_complete_(false),
       ready_ct_(0),
       ice_complete_(false),
       ice_reached_checking_(false),
       received_(0),
@@ -1155,17 +1154,16 @@ class IceGatherTest : public ::testing::
   void TearDown_s() {
     NrIceCtx::internal_DeinitializeGlobal();
   }
 
   void EnsurePeer(const unsigned int flags = ICE_TEST_PEER_OFFERER) {
     if (!peer_) {
       peer_ = new IceTestPeer("P1",
                               flags & ICE_TEST_PEER_OFFERER,
-                              flags & ICE_TEST_PEER_SET_PRIORITIES,
                               flags & ICE_TEST_PEER_ALLOW_LOOPBACK,
                               flags & ICE_TEST_PEER_ENABLED_TCP,
                               flags & ICE_TEST_PEER_ALLOW_LINK_LOCAL,
                               flags & ICE_TEST_PEER_HIDE_NON_DEFAULT);
       peer_->AddStream(1);
     }
   }
 
@@ -1324,40 +1322,39 @@ class IceConnectTest : public ::testing:
                                        NS_DISPATCH_SYNC);
   }
 
   void TearDown_s() {
     NrIceCtx::internal_DeinitializeGlobal();
   }
 
   void AddStream(const std::string& name, int components) {
-    Init(false, false, false);
+    Init(false, false);
     p1_->AddStream(components);
     p2_->AddStream(components);
   }
 
   void RemoveStream(size_t index) {
     p1_->RemoveStream(index);
     p2_->RemoveStream(index);
   }
 
-  void Init(bool set_priorities, bool allow_loopback, bool enable_tcp,
-            bool default_only = false) {
+  void Init(bool allow_loopback, bool enable_tcp, bool default_only = false) {
     if (!initted_) {
-      p1_ = new IceTestPeer("P1", true, set_priorities, allow_loopback,
+      p1_ = new IceTestPeer("P1", true, allow_loopback,
                             enable_tcp, false, default_only);
-      p2_ = new IceTestPeer("P2", false, set_priorities, allow_loopback,
+      p2_ = new IceTestPeer("P2", false, allow_loopback,
                             enable_tcp, false, default_only);
     }
     initted_ = true;
   }
 
   bool Gather(unsigned int waitTime = kDefaultTimeout,
               bool setupStunServers = true) {
-    Init(false, false, false);
+    Init(false, false);
     if (use_nat_) {
       // If we enable nat simulation, but still use a real STUN server somewhere
       // on the internet, we will see failures if there is a real NAT in
       // addition to our simulated one, particularly if it disallows
       // hairpinning.
       if (setupStunServers) {
         UseTestStunServer();
       }
@@ -1701,17 +1698,17 @@ TEST_F(IceGatherTest, TestGatherFakeStun
   Gather();
 }
 
 TEST_F(IceGatherTest, TestGatherStunServerIpAddressDefaultRouteOnly) {
   if (g_stun_server_address.empty()) {
     return;
   }
 
-  peer_ = new IceTestPeer("P1", true, false, false, false, false, true);
+  peer_ = new IceTestPeer("P1", true, false, false, false, true);
   peer_->AddStream(1);
   peer_->SetStunServer(g_stun_server_address, kDefaultStunServerPort);
   peer_->SetFakeResolver();
   Gather();
   ASSERT_FALSE(StreamHasMatchingCandidate(0, " host "));
 }
 
 TEST_F(IceGatherTest, TestGatherFakeStunServerHostname) {
@@ -1890,25 +1887,25 @@ TEST_F(IceGatherTest, TestGatherDisableC
 
 TEST_F(IceGatherTest, TestGatherVerifyNoLoopback) {
   Gather();
   ASSERT_FALSE(StreamHasMatchingCandidate(0, "127.0.0.1"));
 }
 
 TEST_F(IceGatherTest, TestGatherAllowLoopback) {
   // Set up peer with loopback allowed.
-  peer_ = new IceTestPeer("P1", true, false, true);
+  peer_ = new IceTestPeer("P1", true, true);
   peer_->AddStream(1);
   Gather();
   ASSERT_TRUE(StreamHasMatchingCandidate(0, "127.0.0.1"));
 }
 
 TEST_F(IceGatherTest, TestGatherTcpDisabled) {
   // Set up peer with tcp disabled.
-  peer_ = new IceTestPeer("P1", true, false, false, false);
+  peer_ = new IceTestPeer("P1", true, false, false);
   peer_->AddStream(1);
   Gather();
   ASSERT_FALSE(StreamHasMatchingCandidate(0, " TCP "));
   ASSERT_TRUE(StreamHasMatchingCandidate(0, " UDP "));
 }
 
 // Verify that a bogus candidate doesn't cause crashes on the
 // main thread. See bug 856433.
@@ -2002,17 +1999,17 @@ TEST_F(IceGatherTest, TestStunServerTric
   TestStunServer::GetInstance(AF_INET)->SetActive(true);
   WaitForGather();
   ASSERT_TRUE(StreamHasMatchingCandidate(0, "192.0.2.1"));
 }
 
 // Test default route only with our fake STUN server and
 // apparently NATted.
 TEST_F(IceGatherTest, TestFakeStunServerNatedDefaultRouteOnly) {
-  peer_ = new IceTestPeer("P1", true, false, false, false, false, true);
+  peer_ = new IceTestPeer("P1", true, false, false, false, true);
   peer_->AddStream(1);
   UseFakeStunUdpServerWithResponse("192.0.2.1", 3333);
   Gather(0);
   WaitForGather();
   DumpCandidates(0);
   ASSERT_FALSE(StreamHasMatchingCandidate(0, "host"));
   ASSERT_TRUE(StreamHasMatchingCandidate(0, "srflx"));
   NrIceCandidate default_candidate;
@@ -2020,17 +2017,17 @@ TEST_F(IceGatherTest, TestFakeStunServer
   if (NS_SUCCEEDED(rv)) {
     ASSERT_NE(NrIceCandidate::ICE_HOST, default_candidate.type);
   }
 }
 
 // Test default route only with our fake STUN server and
 // apparently non-NATted.
 TEST_F(IceGatherTest, TestFakeStunServerNoNatDefaultRouteOnly) {
-  peer_ = new IceTestPeer("P1", true, false, false, false, false, true);
+  peer_ = new IceTestPeer("P1", true, false, false, false, true);
   peer_->AddStream(1);
   UseTestStunServer();
   Gather(0);
   WaitForGather();
   DumpCandidates(0);
   ASSERT_FALSE(StreamHasMatchingCandidate(0, "host"));
   ASSERT_TRUE(StreamHasMatchingCandidate(0, "srflx"));
 }
@@ -2060,68 +2057,68 @@ TEST_F(IceGatherTest, TestStunTcpAndUdpS
 }
 
 TEST_F(IceConnectTest, TestGather) {
   AddStream("first", 1);
   ASSERT_TRUE(Gather());
 }
 
 TEST_F(IceConnectTest, TestGatherTcp) {
-  Init(false, false, true);
+  Init(false, true);
   AddStream("first", 1);
   ASSERT_TRUE(Gather());
 }
 
 TEST_F(IceConnectTest, TestGatherAutoPrioritize) {
-  Init(false, false, false);
+  Init(false, false);
   AddStream("first", 1);
   ASSERT_TRUE(Gather());
 }
 
 
 TEST_F(IceConnectTest, TestConnect) {
   AddStream("first", 1);
   ASSERT_TRUE(Gather());
   Connect();
 }
 
 TEST_F(IceConnectTest, TestConnectTcp) {
-  Init(false, false, true);
+  Init(false, true);
   AddStream("first", 1);
   ASSERT_TRUE(Gather());
   SetCandidateFilter(IsTcpCandidate);
   SetExpectedTypes(NrIceCandidate::Type::ICE_HOST,
     NrIceCandidate::Type::ICE_HOST, kNrIceTransportTcp);
   Connect();
 }
 
 //TCP SO tests works on localhost only with delay applied:
 //  tc qdisc add dev lo root netem delay 10ms
 TEST_F(IceConnectTest, DISABLED_TestConnectTcpSo) {
-  Init(false, false, true);
+  Init(false, true);
   AddStream("first", 1);
   ASSERT_TRUE(Gather());
   SetCandidateFilter(IsTcpSoCandidate);
   SetExpectedTypes(NrIceCandidate::Type::ICE_HOST,
     NrIceCandidate::Type::ICE_HOST, kNrIceTransportTcp);
   Connect();
 }
 
 // Disabled because this breaks with hairpinning.
 TEST_F(IceConnectTest, DISABLED_TestConnectDefaultRouteOnly) {
-  Init(false, false, false, true);
+  Init(false, false, true);
   AddStream("first", 1);
   ASSERT_TRUE(Gather());
   SetExpectedTypes(NrIceCandidate::Type::ICE_SERVER_REFLEXIVE,
     NrIceCandidate::Type::ICE_SERVER_REFLEXIVE, kNrIceTransportTcp);
   Connect();
 }
 
 TEST_F(IceConnectTest, TestLoopbackOnlySortOf) {
-  Init(false, true, false);
+  Init(true, false);
   AddStream("first", 1);
   SetCandidateFilter(IsLoopbackCandidate);
   ASSERT_TRUE(Gather());
   SetExpectedRemoteCandidateAddr("127.0.0.1");
   Connect();
 }
 
 TEST_F(IceConnectTest, TestConnectBothControllingP1Wins) {
@@ -2194,17 +2191,17 @@ TEST_F(IceConnectTest, TestGatherFullCon
   AddStream("first", 1);
   UseNat();
   SetFilteringType(TestNat::ENDPOINT_INDEPENDENT);
   SetMappingType(TestNat::ENDPOINT_INDEPENDENT);
   ASSERT_TRUE(Gather());
 }
 
 TEST_F(IceConnectTest, TestGatherFullConeAutoPrioritize) {
-  Init(false, true, false);
+  Init(true, false);
   AddStream("first", 1);
   UseNat();
   SetFilteringType(TestNat::ENDPOINT_INDEPENDENT);
   SetMappingType(TestNat::ENDPOINT_INDEPENDENT);
   ASSERT_TRUE(Gather());
 }
 
 
@@ -2215,30 +2212,30 @@ TEST_F(IceConnectTest, TestConnectFullCo
   SetMappingType(TestNat::ENDPOINT_INDEPENDENT);
   SetExpectedTypes(NrIceCandidate::Type::ICE_SERVER_REFLEXIVE,
                    NrIceCandidate::Type::ICE_SERVER_REFLEXIVE);
   ASSERT_TRUE(Gather());
   Connect();
 }
 
 TEST_F(IceConnectTest, TestConnectNoNatRouteOnly) {
-  Init(false, false, false, true);
+  Init(false, false, true);
   AddStream("first", 1);
   UseTestStunServer();
   // Because we are connecting from our host candidate to the
   // other side's apparent srflx (which is also their host)
   // we see a host/srflx pair.
   SetExpectedTypes(NrIceCandidate::Type::ICE_HOST,
                    NrIceCandidate::Type::ICE_SERVER_REFLEXIVE);
   ASSERT_TRUE(Gather(kDefaultTimeout, false));
   Connect();
 }
 
 TEST_F(IceConnectTest, TestConnectFullConeDefaultRouteOnly) {
-  Init(false, false, false, true);
+  Init(false, false, true);
   AddStream("first", 1);
   UseNat();
   SetFilteringType(TestNat::ENDPOINT_INDEPENDENT);
   SetMappingType(TestNat::ENDPOINT_INDEPENDENT);
   SetExpectedTypes(NrIceCandidate::Type::ICE_SERVER_REFLEXIVE,
                    NrIceCandidate::Type::ICE_SERVER_REFLEXIVE);
   ASSERT_TRUE(Gather());
   Connect();
@@ -2401,17 +2398,17 @@ TEST_F(IceConnectTest, TestConnectP2Then
   std::cerr << "Sleeping between trickle streams" << std::endl;
   PR_Sleep(1000);  // Give this some time to settle but not complete
                    // all of ICE.
   SimulateTrickleP1(1);
   WaitForComplete(2);
 }
 
 TEST_F(IceConnectTest, TestConnectAutoPrioritize) {
-  Init(false, false, false);
+  Init(false, false);
   AddStream("first", 1);
   ASSERT_TRUE(Gather());
   Connect();
 }
 
 TEST_F(IceConnectTest, TestConnectTrickleOneStreamOneComponent) {
   AddStream("first", 1);
   ASSERT_TRUE(Gather());
@@ -2584,30 +2581,30 @@ TEST_F(IceConnectTest, TestConnectRealTr
 TEST_F(IceConnectTest, TestSendReceive) {
   AddStream("first", 1);
   ASSERT_TRUE(Gather());
   Connect();
   SendReceive();
 }
 
 TEST_F(IceConnectTest, TestSendReceiveTcp) {
-  Init(false, false, true);
+  Init(false, true);
   AddStream("first", 1);
   ASSERT_TRUE(Gather());
   SetCandidateFilter(IsTcpCandidate);
   SetExpectedTypes(NrIceCandidate::Type::ICE_HOST,
     NrIceCandidate::Type::ICE_HOST, kNrIceTransportTcp);
   Connect();
   SendReceive();
 }
 
 //TCP SO tests works on localhost only with delay applied:
 //  tc qdisc add dev lo root netem delay 10ms
 TEST_F(IceConnectTest, DISABLED_TestSendReceiveTcpSo) {
-  Init(false, false, true);
+  Init(false, true);
   AddStream("first", 1);
   ASSERT_TRUE(Gather());
   SetCandidateFilter(IsTcpSoCandidate);
   SetExpectedTypes(NrIceCandidate::Type::ICE_HOST,
     NrIceCandidate::Type::ICE_HOST, kNrIceTransportTcp);
   Connect();
   SendReceive();
 }
--- a/media/mtransport/test/stunserver.cpp
+++ b/media/mtransport/test/stunserver.cpp
@@ -534,17 +534,17 @@ int TestStunTcpServer::TryOpenListenSock
   addr->addr.protocol=IPPROTO_TCP;
 
   int r = SetInternalPort(addr, port);
 
   if (r)
     return r;
 
   if (ice_ctx_ == NULL)
-    ice_ctx_ = NrIceCtx::Create("stun", false, false, false, false, false, false);
+    ice_ctx_ = NrIceCtx::Create("stun", false, false, false, false, false);
 
   //TODO (nils@mozilla.com) can we replace this with a more basic TCP socket
   // alternative which would allow us to remove the framing argument from the
   // nr_socket_multi_tcp_create() call?
   if(nr_socket_multi_tcp_create(ice_ctx_->ctx(),
      &addr->addr, TCP_TYPE_PASSIVE, 0, 0, 2048,
      &listen_sock_)) {
      MOZ_MTLOG(ML_ERROR, "Couldn't create listen socket");
--- a/media/mtransport/test/turn_unittest.cpp
+++ b/media/mtransport/test/turn_unittest.cpp
@@ -499,17 +499,17 @@ int main(int argc, char **argv)
   NSS_NoDB_Init(nullptr);
   NSS_SetDomesticPolicy();
 
   // Set up the ICE registry, etc.
   // TODO(ekr@rtfm.com): Clean up
   std::string dummy("dummy");
   RUN_ON_THREAD(test_utils->sts_target(),
                 WrapRunnableNM(&NrIceCtx::Create,
-                               dummy, false, false, false, false, false, false,
+                               dummy, false, false, false, false, false,
                                NrIceCtx::ICE_POLICY_ALL),
                 NS_DISPATCH_SYNC);
 
   // Start the tests
   ::testing::InitGoogleTest(&argc, argv);
 
   int rv = RUN_ALL_TESTS();
   delete test_utils;
--- a/media/mtransport/third_party/nICEr/src/net/transport_addr.c
+++ b/media/mtransport/third_party/nICEr/src/net/transport_addr.c
@@ -251,17 +251,17 @@ int nr_ip6_port_to_transport_addr(struct
     if(r=nr_transport_addr_fmt_addr_string(addr))
       ABORT(r);
 
     _status=0;
   abort:
     return(_status);
   }
 
-int nr_transport_addr_get_addrstring(nr_transport_addr *addr, char *str, int maxlen)
+int nr_transport_addr_get_addrstring(const nr_transport_addr *addr, char *str, int maxlen)
   {
     int _status;
     const char *res;
 
     switch(addr->ip_version){
       case NR_IPV4:
         res = inet_ntop(AF_INET, &addr->u.addr4.sin_addr,str,maxlen);
         break;
--- a/media/mtransport/third_party/nICEr/src/net/transport_addr.h
+++ b/media/mtransport/third_party/nICEr/src/net/transport_addr.h
@@ -73,17 +73,17 @@ typedef struct nr_transport_addr_ {
 
 int nr_sockaddr_to_transport_addr(struct sockaddr *saddr, int protocol, int keep, nr_transport_addr *addr);
 
 // addresses, ports in local byte order
 int nr_ip4_port_to_transport_addr(UINT4 ip4, UINT2 port, int protocol, nr_transport_addr *addr);
 int nr_str_port_to_transport_addr(const char *str, UINT2 port, int protocol, nr_transport_addr *addr);
 int nr_ip6_port_to_transport_addr(struct in6_addr* addr6, UINT2 port, int protocol, nr_transport_addr *addr);
 
-int nr_transport_addr_get_addrstring(nr_transport_addr *addr, char *str, int maxlen);
+int nr_transport_addr_get_addrstring(const nr_transport_addr *addr, char *str, int maxlen);
 int nr_transport_addr_get_port(nr_transport_addr *addr, int *port);
 int nr_transport_addr_cmp(nr_transport_addr *addr1,nr_transport_addr *addr2,int mode);
 #define NR_TRANSPORT_ADDR_CMP_MODE_VERSION   1
 #define NR_TRANSPORT_ADDR_CMP_MODE_PROTOCOL  2
 #define NR_TRANSPORT_ADDR_CMP_MODE_ADDR      3
 #define NR_TRANSPORT_ADDR_CMP_MODE_ALL       4
 
 int nr_transport_addr_is_wildcard(nr_transport_addr *addr);
--- a/media/webrtc/signaling/src/peerconnection/PeerConnectionMedia.cpp
+++ b/media/webrtc/signaling/src/peerconnection/PeerConnectionMedia.cpp
@@ -311,17 +311,16 @@ nsresult PeerConnectionMedia::Init(const
   bool default_address_only = false;
 #endif
 
 
   // TODO(ekr@rtfm.com): need some way to set not offerer later
   // Looks like a bug in the NrIceCtx API.
   mIceCtx = NrIceCtx::Create("PC:" + mParentName,
                              true, // Offerer
-                             true, // Explicitly set priorities
                              mParent->GetAllowIceLoopback(),
                              ice_tcp,
                              mParent->GetAllowIceLinkLocal(),
                              default_address_only,
                              policy);
   if(!mIceCtx) {
     CSFLogError(logTag, "%s: Failed to create Ice Context", __FUNCTION__);
     return NS_ERROR_FAILURE;