Skip to content

Commit

Permalink
Bug 1434531 - fix missing TCP relay candidates. r=drno
Browse files Browse the repository at this point in the history
Because the nr_transport_addr_check_compatibility check also includes
protocol, it was failing checks that used to pass.  However, the actual
address used was created farther down in code by copying the current
address and setting the protocol to TCP.  Moving that address copy up
in the processing flow lets the more stringent check work.

MozReview-Commit-ID: 95SOQzxuxXB

--HG--
extra : rebase_source : 95f4cf6d9f10ee4f81c56d7bbe8027c46749cfb8
  • Loading branch information
mfromanmoz authored and vpoddubchak committed Apr 15, 2020
1 parent 8ad3bd8 commit 2a8329b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/ice/ice_component.c
Original file line number Diff line number Diff line change
Expand Up @@ -581,9 +581,14 @@ static int nr_ice_component_initialize_tcp(struct nr_ice_ctx_ *ctx,nr_ice_compon
if (ctx->turn_servers[j].turn_server.transport != IPPROTO_TCP)
continue;

/* Create relay candidate */
if ((r=nr_transport_addr_copy(&addr, &addrs[i].addr)))
ABORT(r);
addr.protocol = IPPROTO_TCP;

if (ctx->turn_servers[j].turn_server.type == NR_ICE_STUN_SERVER_TYPE_ADDR) {
if (nr_transport_addr_check_compatibility(
&addrs[i].addr,
&addr,
&ctx->turn_servers[j].turn_server.u.addr)) {
r_log(LOG_ICE,LOG_INFO,"ICE(%s): Skipping TURN server because of link local mis-match",ctx->label);
continue;
Expand Down Expand Up @@ -613,11 +618,6 @@ static int nr_ice_component_initialize_tcp(struct nr_ice_ctx_ *ctx,nr_ice_compon
}
}

/* Create relay candidate */
if ((r=nr_transport_addr_copy(&addr, &addrs[i].addr)))
ABORT(r);
addr.protocol = IPPROTO_TCP;

/* If we're going to use TLS, make sure that's recorded */
if (ctx->turn_servers[j].turn_server.tls) {
strncpy(addr.tls_host,
Expand Down

0 comments on commit 2a8329b

Please sign in to comment.