summaryrefslogtreecommitdiffstats
path: root/web/attachments/353970-0001-Detect-arguments-passed-via-with-ping-6-command-2908.patch
blob: 60bda5c12c7b65f454d3c3cbe2ec29bd893a398d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
From 96a23a4c117a9c2665ca09e5964eacf028dbcdcf Mon Sep 17 00:00:00 2001
From: Thomas Guyot-Sionnest <dermoth@aei.ca>
Date: Fri, 4 Dec 2009 15:24:15 -0500
Subject: [PATCH] Detect arguments passed via --with-ping[6]-command (#2908236)

---
 NEWS         |    1 +
 configure.in |   19 +++++++++++++++++--
 2 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/NEWS b/NEWS
index f5be201..667e1f0 100644
--- a/NEWS
+++ b/NEWS
@@ -7,6 +7,7 @@ This file documents the major additions and syntax changes between releases.
 	Add proxy-authorization option to check_http (Marcel Kuiper - #1323230, Bryan Irvine - #2863925)
 	check_icmp now increment the sequence counter in each packet
 	Fix usage of repeated -o options in check_snmp
+	Try to detect arguments passed via --with-ping[6]-command and set options accordingly (#2908236)
 	WARNINGS
 	Updated developer documentation to say that performance labels should not have an equals sign or
 	single quote in the label
diff --git a/configure.in b/configure.in
index f354734..d02d7f8 100644
--- a/configure.in
+++ b/configure.in
@@ -877,10 +877,17 @@ ac_cv_ping_has_timeout=no
 if test -n "$with_ping_command"
 then
 	AC_MSG_RESULT([(command-line) $with_ping_command])
-	if test -n "$ac_cv_ping_packets_first"
+	if echo "$with_ping_command" | grep '%d.*%d.*%s' >/dev/null
 	then
 		ac_cv_ping_packets_first=yes
 		ac_cv_ping_has_timeout=yes
+	elif echo "$with_ping_command" | grep '%d.*%s.*%d' >/dev/null || \
+	     echo "$with_ping_command" | grep '%s.*%d.*%d' >/dev/null
+	then
+		ac_cv_ping_has_timeout=yes
+	elif echo "$with_ping_command" | grep '%d.*%s' >/dev/null
+	then
+		ac_cv_ping_packets_first=yes
 	fi
 
 elif [[ "z$ac_cv_uname_s" = "zUnixWare" ]] && \
@@ -981,7 +988,15 @@ ac_cv_ping6_packets_first=no
 if test -n "$with_ping6_command"
 then
 	AC_MSG_RESULT([(command-line) $with_ping6_command])
-	if test -n "$ac_cv_ping6_packets_first"
+	if echo "$with_ping6_command" | grep '%d.*%d.*%s' >/dev/null
+	then
+		ac_cv_ping6_packets_first=yes
+	elif echo "$with_ping6_command" | grep '%d.*%s.*%d' >/dev/null || \
+	     echo "$with_ping6_command" | grep '%s.*%d.*%d' >/dev/null
+	then
+		# Just keep same logic as ping (IPv4) if we ever need ac_cv_ping6_has_timeout
+		true
+	elif echo "$with_ping6_command" | grep '%d.*%s' >/dev/null
 	then
 		ac_cv_ping6_packets_first=yes
 	fi
-- 
1.6.5.1