Use the sock for checking maximum number of conns in General
[silc.git] / apps / silcd / server.c
index 68686e03f9e47cdab78b8a9e47ffa69f48499d82..b8112b3bcf23ff5a1fc700ef11a494faa4c412ec 100644 (file)
@@ -1726,7 +1726,7 @@ SILC_TASK_CALLBACK(silc_server_accept_new_connection)
   }
 
   /* Check for maximum allowed connections */
-  if (server->stat.conn_num > server->config->param.connections_max) {
+  if (sock > server->config->param.connections_max) {
     SILC_LOG_ERROR(("Refusing connection, server is full"));
     server->stat.conn_failures++;
     silc_net_close_connection(sock);