X-Git-Url: https://tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Ftincd.c;h=84036ad4795a5c0f58673293f8dd9f221538a4ca;hb=3e924045ccaab1441b77ff43a2d7eb759b313f7b;hp=5f1447e612a3b919a9873614b339859be1e06092;hpb=6bf3595a915111770b7a167c54ccbca86cfbec78;p=tinc diff --git a/src/tincd.c b/src/tincd.c index 5f1447e6..84036ad4 100644 --- a/src/tincd.c +++ b/src/tincd.c @@ -321,7 +321,7 @@ int main(int argc, char **argv) { if(show_version) { printf("%s version %s (built %s %s, protocol %d.%d)\n", PACKAGE, VERSION, __DATE__, __TIME__, PROT_MAJOR, PROT_MINOR); - printf("Copyright (C) 1998-2012 Ivo Timmermans, Guus Sliepen and others.\n" + printf("Copyright (C) 1998-2013 Ivo Timmermans, Guus Sliepen and others.\n" "See the AUTHORS file for a complete list.\n\n" "tinc comes with ABSOLUTELY NO WARRANTY. This is free software,\n" "and you are welcome to redistribute it under certain conditions;\n" @@ -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);