From 0a6c779f1f24099db2c1cd34cd339e240682525d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Olivier=20Cr=C3=AAte?= Date: Fri, 19 Feb 2016 20:47:08 -0500 Subject: [PATCH] udp-turn: Don't expose GSocket UDP turn sockets should never be read frm directly. Because they may share the same socket with the non-relay, so the incoming data may not be relayed and then the NiceSocket API doesn't allow returning the base socket as the source. --- agent/conncheck.c | 3 +-- socket/udp-turn.c | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/agent/conncheck.c b/agent/conncheck.c index fdb2d71..249c413 100644 --- a/agent/conncheck.c +++ b/agent/conncheck.c @@ -723,10 +723,9 @@ static gboolean priv_conn_keepalive_tick_unlocked (NiceAgent *agent) gchar tmpbuf[INET6_ADDRSTRLEN]; nice_address_to_string (&p->remote->addr, tmpbuf); nice_debug ("Agent %p : Keepalive STUN-CC REQ to '%s:%u', " - "socket=%u (c-id:%u), username='%.*s' (%" G_GSIZE_FORMAT "), " + "(c-id:%u), username='%.*s' (%" G_GSIZE_FORMAT "), " "password='%.*s' (%" G_GSIZE_FORMAT "), priority=%u.", agent, tmpbuf, nice_address_get_port (&p->remote->addr), - g_socket_get_fd(((NiceSocket *)p->local->sockptr)->fileno), component->id, (int) uname_len, uname, uname_len, (int) password_len, password, password_len, priority); } diff --git a/socket/udp-turn.c b/socket/udp-turn.c index f3ad04d..da43b19 100644 --- a/socket/udp-turn.c +++ b/socket/udp-turn.c @@ -241,7 +241,7 @@ nice_udp_turn_socket_new (GMainContext *ctx, NiceAddress *addr, priv_send_data_queue_destroy); sock->type = NICE_SOCKET_TYPE_UDP_TURN; - sock->fileno = base_socket->fileno; + sock->fileno = NULL; sock->addr = *addr; sock->send_messages = socket_send_messages; sock->send_messages_reliable = socket_send_messages_reliable; -- 2.7.4