From 719624e4c25c3ef1b11033609d847aff0036d9a2 Mon Sep 17 00:00:00 2001 From: "Alexander \"Arav\" Andreev" Date: Sun, 31 Mar 2024 20:23:30 +0400 Subject: [PATCH] In parse_argv() alias is not allowed if a program is being run in a server mode. --- src/main.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main.c b/src/main.c index 3836370..99f7011 100644 --- a/src/main.c +++ b/src/main.c @@ -329,7 +329,10 @@ int parse_argv(int argc, const char **argv, struct options *opts) { if (r == -1) r = inet_pton(AF_INET6, opts->addr, &test); opts->is_alias_passed = r == 0; - + + if (opts->command == 's' && opts->is_alias_passed) + return -1; + if (opts->command == '\0' || opts->addr[0] == '\0' || (!opts->is_alias_passed && opts->port == NULL)) return -1;