From aa5f849c5d38a72e40285742a72490dc7e8d4e7e Mon Sep 17 00:00:00 2001 From: David Schweikert Date: Thu, 16 Aug 2012 11:26:16 +0200 Subject: [PATCH] Fix error message on DNS error for IPv6 hosts (#27) --- ChangeLog | 1 + src/fping.c | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 109d934..37308ab 100644 --- a/ChangeLog +++ b/ChangeLog @@ -9,6 +9,7 @@ UNRELEAESD David Schweikert * Set default data size to 56 bytes on all architectures (#18) * Added contrib/fping.spec (Stephen Schaefer, #24) * Convert man-page source to POD for easier maintenance + * Fix error message on DNS error for IPv6 hosts (#27) * Man-page fix: TOS option typo (Thomas Liske, #23) * Man-page fix: inconsistency in regards to numeric arguments (Robert Henney) * Man-page fix: better description of option -q (#15) diff --git a/src/fping.c b/src/fping.c index 73182ce..38b587d 100644 --- a/src/fping.c +++ b/src/fping.c @@ -2208,7 +2208,7 @@ void add_name( char *name ) ret_ga = getaddrinfo(name, NULL, &hints, &res); if (ret_ga) { if(!quiet_flag) - warnx("%s", gai_strerror(ret_ga)); + print_warning("%s: %s\n", name, gai_strerror(ret_ga)); num_noaddress++; return; } @@ -2216,7 +2216,7 @@ void add_name( char *name ) else hostname = name; if (!res->ai_addr) { if(!quiet_flag) - warnx("getaddrinfo failed"); + print_warning("%s: getaddrinfo failed\n", name); num_noaddress++; return; } @@ -2232,7 +2232,7 @@ void add_name( char *name ) 64, NULL, 0, NI_NUMERICHOST); if (ret) { if(!quiet_flag) { - warnx("%s", gai_strerror(ret_ga)); + print_warning("%s: %s\n", name, gai_strerror(ret_ga)); } num_noaddress++; return;