conncheck: fix keepalive stun agent initialisation
authorPhilip Withnall <philip@tecnocode.co.uk>
Tue, 1 Mar 2016 23:01:14 +0000 (23:01 +0000)
committerPhilip Withnall <philip@tecnocode.co.uk>
Tue, 1 Mar 2016 23:01:21 +0000 (23:01 +0000)
With this patch, we send keepalive binding requests using agent
compatibility flags, instead of RFC 3489 classic stun. The peer stun
agent will known how to handle it, and won't be confused by the
uncompatible RFC 3489 message, causing "no cookie" errors in the debug
log.

Reviewed-by: Olivier CrĂȘte <olivier.crete@collabora.com>
Differential Revision: https://phabricator.freedesktop.org/D804

agent/conncheck.c

index d704357..3adf2e3 100644 (file)
@@ -731,12 +731,7 @@ static gboolean priv_conn_keepalive_tick_unlocked (NiceAgent *agent)
 
           nice_address_set_port (&stun_server, agent->stun_server_port);
 
-          /* FIXME: This will cause the stun response to arrive on the socket
-           * but the stun agent will not be able to parse it due to an invalid
-           * stun message since RFC3489 will not be compatible, and the response
-           * will be forwarded to the application as user data */
-          stun_agent_init (&stun_agent, STUN_ALL_KNOWN_ATTRIBUTES,
-              STUN_COMPATIBILITY_RFC3489, 0);
+          nice_agent_init_stun_agent (agent, &stun_agent);
 
           buffer_len = stun_usage_bind_create (&stun_agent,
               &stun_message, stun_buffer, sizeof(stun_buffer));