summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plugins-root/check_icmp.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/plugins-root/check_icmp.c b/plugins-root/check_icmp.c
index 749e2d44..1a2a1772 100644
--- a/plugins-root/check_icmp.c
+++ b/plugins-root/check_icmp.c
@@ -1362,13 +1362,14 @@ add_target(char *arg)
1362 else { 1362 else {
1363 errno = 0; 1363 errno = 0;
1364 memset(&hints, 0, sizeof(hints)); 1364 memset(&hints, 0, sizeof(hints));
1365 hints.ai_family = address_family == AF_INET ? PF_INET : PF_INET6; 1365 hints.ai_family = AF_UNSPEC;
1366 hints.ai_socktype = SOCK_RAW; 1366 hints.ai_socktype = SOCK_RAW;
1367 if((error = getaddrinfo(arg, NULL, &hints, &res)) != 0) { 1367 if((error = getaddrinfo(arg, NULL, &hints, &res)) != 0) {
1368 errno = 0; 1368 errno = 0;
1369 crash("Failed to resolve %s: %s", arg, gai_strerror(error)); 1369 crash("Failed to resolve %s: %s", arg, gai_strerror(error));
1370 return -1; 1370 return -1;
1371 } 1371 }
1372 address_family = res->ai_family;
1372 } 1373 }
1373 1374
1374 /* possibly add all the IP's as targets */ 1375 /* possibly add all the IP's as targets */