In parse_argv() alias is not allowed if a program is being run in a server mode.
This commit is contained in:
parent
7d08203d61
commit
719624e4c2
@ -329,7 +329,10 @@ int parse_argv(int argc, const char **argv, struct options *opts) {
|
|||||||
if (r == -1)
|
if (r == -1)
|
||||||
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;
|
||||||
|
Loading…
Reference in New Issue
Block a user