Introducing the Big Tinc Lock.
[tinc] / src / net_socket.c
index 28b6067..3c79cee 100644 (file)
@@ -498,6 +498,7 @@ void handle_new_meta_connection(void *data) {
 
                configure_tcp(c);
 
+               mutex_lock(&mutex);
                connection_add(c);
 
                c->allow_request = ID;
@@ -507,6 +508,7 @@ void handle_new_meta_connection(void *data) {
                        logger(LOG_ERR, "create_thread() failed: %s", strerror(errno));
                        abort();
                }
+               mutex_unlock(&mutex);
        }
 }