Bug 915420 - Use foundation address instead of relay address to determine priority r=bwc
authorEric Rescorla <ekr@rtfm.com>
Wed, 11 Sep 2013 15:43:09 -0700
changeset 159625 28aa5abe0efb6802bc335635231bf550c589f1e4
parent 159624 2494c41c421fbb7275b90fbb6316584773762298
child 159626 3a9f27b2a213ad7a5424f3c19b1db3924d87c365
push id2961
push userlsblakk@mozilla.com
push dateMon, 28 Oct 2013 21:59:28 +0000
treeherdermozilla-beta@73ef4f13486f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbwc
bugs915420
milestone26.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 915420 - Use foundation address instead of relay address to determine priority r=bwc
media/mtransport/third_party/nICEr/src/ice/ice_candidate.c
--- a/media/mtransport/third_party/nICEr/src/ice/ice_candidate.c
+++ b/media/mtransport/third_party/nICEr/src/ice/ice_candidate.c
@@ -55,16 +55,17 @@ static char *RCSSTRING __UNUSED__="$Id: 
 #include "stun_client_ctx.h"
 #include "stun_server_ctx.h"
 #include "turn_client_ctx.h"
 #include "ice_ctx.h"
 #include "ice_candidate.h"
 #include "ice_reg.h"
 #include "ice_util.h"
 #include "nr_socket_turn.h"
+#include "nr_socket.h"
 
 static int next_automatic_preference = 224;
 
 static int nr_ice_candidate_initialize2(nr_ice_candidate *cand);
 static int nr_ice_get_foundation(nr_ice_ctx *ctx,nr_ice_candidate *cand);
 static int nr_ice_srvrflx_start_stun(nr_ice_candidate *cand);
 static void nr_ice_srvrflx_stun_finished_cb(NR_SOCKET sock, int how, void *cb_arg);
 #ifdef USE_TURN
@@ -377,18 +378,22 @@ int nr_ice_candidate_compute_priority(nr
         }
         else {
           ABORT(r);
         }
       }
     }
     else {
       char key_of_interface[MAXIFNAME + 41];
+      nr_transport_addr addr;
 
-      if(r=nr_transport_addr_fmt_ifname_addr_string(&cand->base,key_of_interface,
+      if(r=nr_socket_getaddr(cand->isock->sock, &addr))
+        ABORT(r);
+
+      if(r=nr_transport_addr_fmt_ifname_addr_string(&addr,key_of_interface,
          sizeof(key_of_interface))) {
         ABORT(r);
       }
       if(r=nr_interface_prioritizer_get_priority(cand->ctx->interface_prioritizer,
          key_of_interface,&interface_preference)) {
         ABORT(r);
       }
     }