do not set socket tos if fileno == NULL
authorYouness Alaoui <youness.alaoui@collabora.co.uk>
Tue, 8 Apr 2014 07:37:59 +0000 (03:37 -0400)
committerOlivier CrĂȘte <olivier.crete@ocrete.ca>
Thu, 15 May 2014 13:43:15 +0000 (09:43 -0400)
agent/agent.c

index 0cc32b0..5138597 100644 (file)
@@ -4239,6 +4239,9 @@ nice_agent_set_selected_remote_candidate (
 void
 _priv_set_socket_tos (NiceAgent *agent, NiceSocket *sock, gint tos)
 {
+  if (sock->fileno == NULL)
+    return;
+
   if (setsockopt (g_socket_get_fd (sock->fileno), IPPROTO_IP,
           IP_TOS, (const char *) &tos, sizeof (tos)) < 0) {
     nice_debug ("Agent %p: Could not set socket ToS: %s", agent,