ping: use the in6_addr buffer when parsing src address as AF_INET6

Reviewed by:	kp
MFC after:	1 week
Sponsored by:	Rubicon Communications, LLC ("Netgate")
This commit is contained in:
R. Christian McDonald 2023-08-08 14:40:02 -04:00 committed by Kristof Provost
parent 76fc279f1b
commit 9f2cddd261

View file

@ -102,7 +102,7 @@ main(int argc, char *argv[])
*/
if (inet_pton(AF_INET, optarg, &a) == 1)
ipv4 = true;
else if (inet_pton(AF_INET6, optarg, &a) == 1)
else if (inet_pton(AF_INET6, optarg, &a6) == 1)
ipv6 = true;
break;
#endif