aboutsummaryrefslogtreecommitdiff
path: root/sbin/ping6
diff options
context:
space:
mode:
authorYoshinobu Inoue <shin@FreeBSD.org>1999-12-28 05:37:39 +0000
committerYoshinobu Inoue <shin@FreeBSD.org>1999-12-28 05:37:39 +0000
commit9b59fde4e0c287dde4ddb2f4f34f4b0a58dacbf9 (patch)
treeaa31366c35d453783e0dbf9fffbed908be3f0fad /sbin/ping6
parent0e17bca17c7b9244ca74b3ea91f6b2ea7376e38a (diff)
Notes
Diffstat (limited to 'sbin/ping6')
-rw-r--r--sbin/ping6/ping6.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/sbin/ping6/ping6.c b/sbin/ping6/ping6.c
index d1186559400c..34de2bdc00b4 100644
--- a/sbin/ping6/ping6.c
+++ b/sbin/ping6/ping6.c
@@ -434,6 +434,8 @@ main(argc, argv)
ret_ga = getaddrinfo(target, NULL, &hints, &res);
if (ret_ga) {
fprintf(stderr, "ping6: %s\n", gai_strerror(ret_ga));
+ if (ret_ga == EAI_SYSTEM)
+ errx(1, "%s", strerror(errno));
exit(1);
}
if (res->ai_canonname)
@@ -586,8 +588,12 @@ main(argc, argv)
for (hops = 0; hops < argc - 1; hops++) {
struct addrinfo *iaip;
- if ((error = getaddrinfo(argv[hops], NULL, &hints, &iaip)))
- errx(1, gai_strerror(error));
+ if ((error = getaddrinfo(argv[hops], NULL, &hints, &iaip))) {
+ fprintf(stderr, "ping6: %s\n", gai_strerror(error));
+ if (error == EAI_SYSTEM)
+ errx(1, strerror(errno));
+ exit(1);
+ }
if (SIN6(res->ai_addr)->sin6_family != AF_INET6)
errx(1,
"bad addr family of an intermediate addr");