From a2eb4e8210deb37133ece1e6e94aad4e6c5bea14 Mon Sep 17 00:00:00 2001 From: Oliver Skibbe Date: Mon, 28 Sep 2015 14:22:09 +0200 Subject: * check_ping: added option for packet size - added option (-s/--packetsize) for setting packet size (limited to 65528 Bytes, according to RFC791) - added DEFAULT_PACKET_SIZE constant with 56 Bytes) - disabled ping check for UnixWare in autoconf: if condition and with_ping_command had different syntax --- configure.ac | 37 ++++++++++++++++++++++++++++++++----- 1 file changed, 32 insertions(+), 5 deletions(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index dfc37b5e..5e2a0b38 100644 --- a/configure.ac +++ b/configure.ac @@ -1079,6 +1079,7 @@ AC_ARG_WITH(ping_command, AC_MSG_CHECKING(for ICMP ping syntax) ac_cv_ping_packets_first=no ac_cv_ping_has_timeout=no +ac_cv_ping_has_packetsize=no if test -n "$with_ping_command" then AC_MSG_RESULT([(command-line) $with_ping_command]) @@ -1102,12 +1103,22 @@ then ac_cv_ping_has_timeout=yes AC_MSG_RESULT([$with_ping_command]) -elif [[ "z$ac_cv_uname_s" = "zUnixWare" ]] && \ - $PATH_TO_PING -n -s 127.0.0.1 56 1 2>/dev/null | \ +# XXX with_ping_command not same like if condition +#elif [[ "z$ac_cv_uname_s" = "zUnixWare" ]] && \ +# $PATH_TO_PING -n -s 127.0.0.1 56 1 2>/dev/null | \ +# egrep -i "^round-trip|^rtt" >/dev/null +#then +# with_ping_command="$PATH_TO_PING -n -U -c %d %s" +# ac_cv_ping_packets_first=yes +# AC_MSG_RESULT([$with_ping_command]) + +elif $PATH_TO_PING -n -U -w 10 -c 1 -s 56 127.0.0.1 2>/dev/null | \ egrep -i "^round-trip|^rtt" >/dev/null then - with_ping_command="$PATH_TO_PING -n -U -c %d %s" + with_ping_command="$PATH_TO_PING -n -U -w %d -c %d -s %d %s" ac_cv_ping_packets_first=yes + ac_cv_ping_has_timeout=yes + ac_cv_ping_has_packetsize=yes AC_MSG_RESULT([$with_ping_command]) elif $PATH_TO_PING -4 -n -U -w 10 -c 1 127.0.0.1 2>/dev/null | \ @@ -1126,6 +1137,14 @@ then ac_cv_ping_has_timeout=yes AC_MSG_RESULT([$with_ping_command]) +elif $PATH_TO_PING -n -U -c 1 -s 56 127.0.0.1 2>/dev/null | \ + egrep -i "^round-trip|^rtt" >/dev/null +then + with_ping_command="$PATH_TO_PING -n -U -c %d -s %d %s" + ac_cv_ping_packets_first=yes + ac_cv_ping_has_packetsize=yes + AC_MSG_RESULT([$with_ping_command]) + elif $PATH_TO_PING -n -U -c 1 127.0.0.1 2>/dev/null | \ egrep -i "^round-trip|^rtt" >/dev/null then @@ -1155,13 +1174,15 @@ then elif $PATH_TO_PING -n -s 127.0.0.1 56 1 2>/dev/null | \ egrep -i "^round-trip|^rtt" >/dev/null then - with_ping_command="$PATH_TO_PING -n -s %s 56 %d" + with_ping_command="$PATH_TO_PING -n -s %s %d %d" + ac_cv_ping_has_packetsize=yes AC_MSG_RESULT([$with_ping_command]) elif $PATH_TO_PING -n -h 127.0.0.1 -s 56 -c 1 2>/dev/null | \ egrep -i "^round-trip|^rtt" >/dev/null then - with_ping_command="$PATH_TO_PING -n -h %s -s 56 -c %d" + with_ping_command="$PATH_TO_PING -n -h %s -s %d -c %d" + ac_cv_ping_has_packetsize=yes AC_MSG_RESULT([$with_ping_command]) elif $PATH_TO_PING -n -s 56 -c 1 127.0.0.1 2>/dev/null | \ @@ -1197,6 +1218,12 @@ then [Define if ping has its own timeout option that should be set]) fi +if test "x$ac_cv_ping_has_packetsize" != "xno" +then + AC_DEFINE(PING_HAS_PACKETSIZE,1, + [Define if ping has an option for custom packet size]) +fi + AC_ARG_WITH(ping6_command, ACX_HELP_STRING([--with-ping6-command=SYNTAX], [sets syntax for ICMPv6 ping]), -- cgit v1.2.3-74-g34f1