Alright, a test struct sockaddr is not needed for inet_pton().
This commit is contained in:
parent
68cb43795b
commit
9288797c03
@ -288,11 +288,10 @@ int parse_argv(int argc, const char **argv, struct options *opts) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (command_arg_num == 1) {
|
if (command_arg_num == 1) {
|
||||||
struct sockaddr test = {0};
|
int r = inet_pton(AF_INET, opts->addr, NULL);
|
||||||
int r = inet_pton(AF_INET, opts->addr, &test);
|
|
||||||
if (r == -1)
|
if (r == -1)
|
||||||
r = inet_pton(AF_INET6, opts->addr, &test);
|
r = inet_pton(AF_INET6, opts->addr, NULL);
|
||||||
opts->is_alias_passed = r != 1;
|
opts->is_alias_passed = r == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// opts->is_alias_passed = ((opts->addr[0]>>4) & 0xf) != 0x3;
|
// opts->is_alias_passed = ((opts->addr[0]>>4) & 0xf) != 0x3;
|
||||||
|
Loading…
Reference in New Issue
Block a user