Fix arg parser for --ip and --ip-opt

#13
This commit is contained in:
ruti 2024-07-16 10:59:18 +03:00
parent a8440ecba2
commit c732673c76

4
main.c
View File

@ -278,6 +278,8 @@ int get_addr(const char *str, struct sockaddr_ina *addr)
else else
addr->in.sin_addr = ( addr->in.sin_addr = (
(struct sockaddr_in *)res->ai_addr)->sin_addr; (struct sockaddr_in *)res->ai_addr)->sin_addr;
addr->sa.sa_family = res->ai_addr->sa_family;
freeaddrinfo(res); freeaddrinfo(res);
return 0; return 0;
@ -633,7 +635,7 @@ int main(int argc, char **argv)
break; break;
case 'k': case 'k':
if (dp->ip_options != ip_option) { if (dp->ip_options) {
continue; continue;
} }
if (optarg) if (optarg)