X-Git-Url: https://tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Ftincctl.c;h=664b2eaa1b4306761284afd2bb9b9aba3fb832e0;hb=f71ab70351e8d5dfdc91c9808d142cf93d2a5d61;hp=8b49c4499b2c508ba04bc4595c377cfffe6a2bac;hpb=95baa36f10743d4d2bd6f6ff05457f77bd14e96d;p=tinc diff --git a/src/tincctl.c b/src/tincctl.c index 8b49c449..664b2eaa 100644 --- a/src/tincctl.c +++ b/src/tincctl.c @@ -93,6 +93,17 @@ static struct option const long_options[] = { static void version(void) { printf("%s version %s (built %s %s, protocol %d.%d)\n", PACKAGE, BUILD_VERSION, BUILD_DATE, BUILD_TIME, PROT_MAJOR, PROT_MINOR); + printf("Features:" +#ifdef HAVE_READLINE + " readline" +#endif +#ifdef HAVE_CURSES + " curses" +#endif +#ifndef DISABLE_LEGACY + " legacy_protocol" +#endif + "\n\n"); printf("Copyright (C) 1998-2018 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" @@ -3328,6 +3339,11 @@ static int cmd_shell(int argc, char *argv[]) { return result; } +static void cleanup() { + free(tinc_conf); + free(hosts_dir); + free_names(); +} int main(int argc, char *argv[]) { program_name = argv[0]; @@ -3342,6 +3358,7 @@ int main(int argc, char *argv[]) { make_names(false); xasprintf(&tinc_conf, "%s" SLASH "tinc.conf", confbase); xasprintf(&hosts_dir, "%s" SLASH "hosts", confbase); + atexit(cleanup); if(show_version) { version(); @@ -3363,7 +3380,8 @@ int main(int argc, char *argv[]) { #endif - srand(time(NULL)); + gettimeofday(&now, NULL); + srand(now.tv_sec + now.tv_usec); crypto_init(); if(optind >= argc) {