summaryrefslogtreecommitdiffstats
path: root/plugins/check_fping.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/check_fping.c')
-rw-r--r--plugins/check_fping.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/plugins/check_fping.c b/plugins/check_fping.c
index 1c2b7689..cf9c2d1c 100644
--- a/plugins/check_fping.c
+++ b/plugins/check_fping.c
@@ -83,14 +83,14 @@ int main(int argc, char **argv) {
83 83
84 /* compose the command */ 84 /* compose the command */
85#ifdef PATH_TO_FPING6 85#ifdef PATH_TO_FPING6
86 if (address_family != AF_INET && is_inet6_addr(server)) { 86 if (address_family == AF_INET6 || (address_family == AF_UNSPEC && is_inet6_addr(server))) {
87 fping_prog = strdup(PATH_TO_FPING6); 87 fping_prog = strdup(PATH_TO_FPING6);
88 } else { 88 } else {
89 xasprintf(&option_string, "%s-4 ", option_string); 89 xasprintf(&option_string, "%s-4 ", option_string);
90 fping_prog = strdup(PATH_TO_FPING); 90 fping_prog = strdup(PATH_TO_FPING);
91 } 91 }
92#else 92#else
93 if (address_family != AF_INET) { 93 if (address_family == AF_INET6 || (address_family == AF_UNSPEC && is_inet6_addr(server))) {
94 // -4 / -6 must be set explicitly as when a host has dual stack 94 // -4 / -6 must be set explicitly as when a host has dual stack
95 // if we don't specify -4 then fping selects ipv6 which can mess 95 // if we don't specify -4 then fping selects ipv6 which can mess
96 // with some checks. 96 // with some checks.