summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Obser <florian@cvs.openbsd.org>2016-09-18 17:27:26 +0000
committerFlorian Obser <florian@cvs.openbsd.org>2016-09-18 17:27:26 +0000
commit19a77a099c7f69f28b7e9e090458fab589ad7794 (patch)
tree8a739b450ae22c13b32b6d359918429edd9917d3
parente18a58c1b89882b0dec12251558a0f724d9d7766 (diff)
unbreak IPv6 source selection
-rw-r--r--sbin/ping/ping.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sbin/ping/ping.c b/sbin/ping/ping.c
index fd656099f85..613e600a464 100644
--- a/sbin/ping/ping.c
+++ b/sbin/ping/ping.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ping.c,v 1.211 2016/09/18 15:14:08 deraadt Exp $ */
+/* $OpenBSD: ping.c,v 1.212 2016/09/18 17:27:25 florian Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -488,7 +488,7 @@ main(int argc, char *argv[])
hints.ai_family = dst->sa_family;
if ((error = getaddrinfo(source, NULL, &hints, &res)))
errx(1, "%s: %s", source, gai_strerror(error));
- if (res->ai_addrlen != sizeof(from4))
+ if (res->ai_addrlen != dst->sa_len)
errx(1, "size of sockaddr mismatch");
memcpy(from, res->ai_addr, res->ai_addrlen);
freeaddrinfo(res);