X-Git-Url: https://tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Ftincd.c;h=48f344e738ad0c97fdd30ab42bbaa87942461b2d;hb=41583d5dcfc1277b1a203478de4cce2cd0cda1b1;hp=3d6db8b9c8b4b112e32347926976d396df1bd610;hpb=5e00a24e1f13fa70a6945831c409d873b7809d11;p=tinc diff --git a/src/tincd.c b/src/tincd.c index 3d6db8b9..48f344e7 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,19 +432,17 @@ int main2(int argc, char **argv) { /* Start main loop. It only exits when tinc is killed. */ - status = main_loop(); + logger(DEBUG_ALWAYS, LOG_NOTICE, "Ready"); - /* Shutdown properly. */ + try_outgoing_connections(); - if(debug_level >= DEBUG_CONNECTIONS) - devops.dump_stats(); + status = main_loop(); - close_network_connections(); + /* Shutdown properly. */ end: - exit_control(); + close_network_connections(); -end_nonet: logger(DEBUG_ALWAYS, LOG_NOTICE, "Terminating"); free(priority);