X-Git-Url: https://www.tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Ftincd.c;h=ce22b7b68795f099bfb545d30b525b0bc95bbc59;hb=refs%2Fheads%2F1.0-gnutls;hp=1a5677f1295c264eb94fca71bdc38d7fd61f3379;hpb=5900c07fab39d2833ea66429ad652ca49a91a508;p=tinc diff --git a/src/tincd.c b/src/tincd.c index 1a5677f1..ce22b7b6 100644 --- a/src/tincd.c +++ b/src/tincd.c @@ -17,7 +17,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - $Id: tincd.c,v 1.10.4.89 2003/10/06 16:13:08 guus Exp $ + $Id: tincd.c,v 1.10.4.90 2003/12/07 14:31:09 guus Exp $ */ #include "system.h" @@ -31,10 +31,7 @@ #include #endif -#include -#include -#include -#include +#include #include @@ -286,6 +283,10 @@ static void indicator(int a, int b, void *p) */ static bool keygen(int bits) { + fprintf(stderr, _("Use certtool!\n")); + return false; + +#if 0 RSA *rsa_key; FILE *f; char *name = NULL; @@ -338,6 +339,7 @@ static bool keygen(int bits) free(filename); return true; +#endif } /* @@ -437,7 +439,7 @@ int main(int argc, char **argv) { logger(LOG_ERR, _("mlockall() not supported on this platform!")); #endif - return -1; + return 1; } g_argv = argv; @@ -446,9 +448,7 @@ int main(int argc, char **argv) /* Slllluuuuuuurrrrp! */ - RAND_load_file("/dev/urandom", 1024); - - OpenSSL_add_all_algorithms(); + gnutls_global_init(); if(generate_keys) { read_server_config(); @@ -483,17 +483,10 @@ int main2(int argc, char **argv) return 1; - /* Setup sockets and open device. If it doesn't work, don't give up but try again. */ + /* Setup sockets and open device. */ - while(!setup_network_connections()) { - if(do_detach) { - logger(LOG_NOTICE, _("Restarting in %d seconds!"), maxtimeout); - sleep(maxtimeout); - } else { - logger(LOG_ERR, _("Not restarting.")); - return 1; - } - } + if(!setup_network_connections()) + goto end; /* Start main loop. It only exits when tinc is killed. */ @@ -506,6 +499,7 @@ int main2(int argc, char **argv) ifdebug(CONNECTIONS) dump_device_stats(); +end: logger(LOG_NOTICE, _("Terminating")); #ifndef HAVE_MINGW