1
0

In parse_argv() alias is not allowed if a program is being run in a server mode.

This commit is contained in:
Alexander Andreev 2024-03-31 20:23:30 +04:00
parent 7d08203d61
commit 719624e4c2
Signed by: Arav
GPG Key ID: 25969B23DCB5CA34

View File

@ -330,6 +330,9 @@ int parse_argv(int argc, const char **argv, struct options *opts) {
r = inet_pton(AF_INET6, opts->addr, &test); r = inet_pton(AF_INET6, opts->addr, &test);
opts->is_alias_passed = r == 0; opts->is_alias_passed = r == 0;
if (opts->command == 's' && opts->is_alias_passed)
return -1;
if (opts->command == '\0' || opts->addr[0] == '\0' if (opts->command == '\0' || opts->addr[0] == '\0'
|| (!opts->is_alias_passed && opts->port == NULL)) || (!opts->is_alias_passed && opts->port == NULL))
return -1; return -1;