X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=src%2Ftincd.c;h=84036ad4795a5c0f58673293f8dd9f221538a4ca;hb=09b0b49b98cc16f6b281e4e635c2c70234e38865;hp=3d6db8b9c8b4b112e32347926976d396df1bd610;hpb=8f8424445810aa7d5e9d4d537494e64811a8e29f;p=meshlink diff --git a/src/tincd.c b/src/tincd.c index 3d6db8b9..84036ad4 100644 --- a/src/tincd.c +++ b/src/tincd.c @@ -400,14 +400,7 @@ int main2(int argc, char **argv) { /* Setup sockets and open device. */ if(!setup_network()) - goto end_nonet; - - if(!init_control()) - goto end_nonet; - - /* Initiate all outgoing connections. */ - - try_outgoing_connections(); + goto end; /* Change process priority */ @@ -439,6 +432,10 @@ int main2(int argc, char **argv) { /* Start main loop. It only exits when tinc is killed. */ + logger(DEBUG_ALWAYS, LOG_NOTICE, "Ready"); + + try_outgoing_connections(); + status = main_loop(); /* Shutdown properly. */ @@ -446,12 +443,9 @@ int main2(int argc, char **argv) { if(debug_level >= DEBUG_CONNECTIONS) devops.dump_stats(); - close_network_connections(); - end: - exit_control(); + close_network_connections(); -end_nonet: logger(DEBUG_ALWAYS, LOG_NOTICE, "Terminating"); free(priority);