diff options
Diffstat (limited to 'src/config.c')
-rw-r--r-- | src/config.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/config.c b/src/config.c index af32975..6fd8def 100644 --- a/src/config.c +++ b/src/config.c @@ -146,6 +146,7 @@ void fastd_configure(fastd_context *ctx, fastd_config *conf, int argc, char *con char *charptr; char *endptr; char *addrstr; + bool keygen = false; while (i < argc) { @@ -305,9 +306,20 @@ void fastd_configure(fastd_context *ctx, fastd_config *conf, int argc, char *con continue; } + IF_OPTION("--generate-key") { + keygen = true; + continue; + } + exit_error(ctx, "config error: unknown option `%s'", argv[i]); } + if (keygen) { + ctx->conf = conf; + conf->protocol->generate_key(ctx); + exit(0); + } + conf->n_floating = 0; conf->n_v4 = 0; conf->n_v6 = 0; |