Bug 1186339 - skip STUN/TURN servers with non-matching IP versions for TCP sockets. r=bwc

This commit is contained in:
Nils Ohlmeier [:drno] 2015-07-22 10:54:11 -07:00
parent 50ae71826f
commit aa4b06956c
2 changed files with 9 additions and 2 deletions

View File

@ -555,7 +555,7 @@ int nr_ice_candidate_initialize(nr_ice_candidate *cand, NR_async_cb ready_cb, vo
if(cand->stun_server->type == NR_ICE_STUN_SERVER_TYPE_ADDR) {
if(cand->base.ip_version != cand->stun_server->u.addr.ip_version) {
r_log(LOG_ICE, LOG_INFO, "ICE-CANDIDATE(%s): Skipping srflx/relayed candidate with different IP version (%d) than STUN/TURN server (%d).", cand->label,cand->base.ip_version,cand->stun_server->u.addr.ip_version);
r_log(LOG_ICE, LOG_INFO, "ICE-CANDIDATE(%s): Skipping srflx/relayed candidate with different IP version (%u) than STUN/TURN server (%u).", cand->label,cand->base.ip_version,cand->stun_server->u.addr.ip_version);
ABORT(R_NOT_FOUND); /* Same error code when DNS lookup fails */
}

View File

@ -170,8 +170,15 @@ static int nr_socket_multi_tcp_create_stun_server_socket(
nr_tcp_socket_ctx *tcp_socket_ctx=0;
nr_socket * nrsock;
if (stun_server->transport!=IPPROTO_TCP)
if (stun_server->transport!=IPPROTO_TCP) {
r_log(LOG_ICE,LOG_INFO,"%s:%d function %s skipping UDP STUN server(addr:%s)",__FILE__,__LINE__,__FUNCTION__,stun_server->u.addr.as_string);
ABORT(R_BAD_ARGS);
}
if (stun_server->u.addr.ip_version!=addr->ip_version) {
r_log(LOG_ICE,LOG_INFO,"%s:%d function %s skipping STUN with different IP version (%u) than local socket (%u),",__FILE__,__LINE__,__FUNCTION__,stun_server->u.addr.ip_version,addr->ip_version);
ABORT(R_BAD_ARGS);
}
if ((r=nr_socket_factory_create_socket(sock->ctx->socket_factory,addr, &nrsock)))
ABORT(r);