From 356e7b3a69dcfdad8f8d09ce921c11e0566cb99c Mon Sep 17 00:00:00 2001 From: David Schweikert Date: Tue, 10 Jan 2017 15:52:58 +0100 Subject: [PATCH 1/4] fix compatibility issue with MacOS in release 3.14 (fixes #109) --- src/fping.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/fping.c b/src/fping.c index fd424eb..b02493c 100644 --- a/src/fping.c +++ b/src/fping.c @@ -387,12 +387,17 @@ int main( int argc, char **argv ) switch( c ) { case 'M': +#ifdef IP_MTU_DISCOVER { - int val = IP_PMTUDISC_DO; - if (setsockopt(s, IPPROTO_IP, IP_MTU_DISCOVER, &val, sizeof(val))) { - perror("setsockopt IP_MTU_DISCOVER"); - } + int val = IP_PMTUDISC_DO; + if (setsockopt(s, IPPROTO_IP, IP_MTU_DISCOVER, &val, sizeof(val))) { + perror("setsockopt IP_MTU_DISCOVER"); + } } +#else + fprintf(stderr, "-M option not supported on this platform\n"); + exit(1); +#endif break; case 't': From 178d07ddc047ed81ba1231b8c0a6f8dc7390ae86 Mon Sep 17 00:00:00 2001 From: David Schweikert Date: Wed, 11 Jan 2017 09:45:56 +0100 Subject: [PATCH 2/4] document -N in documentation and implement small fixes in test suite for macOS --- ChangeLog | 2 +- ci/test-14-ping-internet-hosts.pl | 2 +- ci/test-issue-56.pl | 10 +++++++++- doc/fping.pod | 4 ++++ 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index c5f7573..2168ae9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,7 +2,7 @@ * Version 3.14 * (feature) Ignore network and broadcast for cidrs /31 and /32 (#102, Martin Topholm) * (feature) New option '-M' to set the "Don't Fragment" flag (#91, Don Bowman) - * (feature) New option '-N' to output statistics for netdata (see: http://my-netdata.io/, #10, Costa Tsaousis) + * (feature) New option '-N' to output statistics for netdata (see: http://my-netdata.io/, #105, Costa Tsaousis) * (feature) New option '-o' to calculate total outage time (#90, @jgerbeck) * (bugfix) Exit code should be 2 when the hostname can't be resolved (fixes #98, reported by @green-fox) diff --git a/ci/test-14-ping-internet-hosts.pl b/ci/test-14-ping-internet-hosts.pl index 388acfe..3c7aadb 100755 --- a/ci/test-14-ping-internet-hosts.pl +++ b/ci/test-14-ping-internet-hosts.pl @@ -43,7 +43,7 @@ $cmd->stderr_is_eq(""); # fping6 -A -n SKIP: { - if(system("/sbin/ifconfig | grep inet6") != 0) { + if(system("/sbin/ifconfig | grep inet6.*Scope:Global") != 0) { skip 'No IPv6 on this host', 3; } my $cmd = Test::Command->new(cmd => "fping6 -n -A 2001:4860:4860::8888"); diff --git a/ci/test-issue-56.pl b/ci/test-issue-56.pl index e1806bb..e36cc14 100755 --- a/ci/test-issue-56.pl +++ b/ci/test-issue-56.pl @@ -1,8 +1,16 @@ #!/usr/bin/perl -w # regression testing for github issue #56 +# +use Test::Command; +use Test::More; -use Test::Command tests => 3; +if( $^O eq 'darwin' ) { + plan skip_all => 'Test disabled on MacOS'; + exit 0; +} + +plan tests => 3; my $cmd1 = Test::Command->new(cmd => "fping -t100 -p100 -C3 255.255.255.255"); $cmd1->exit_is_num(1); diff --git a/doc/fping.pod b/doc/fping.pod index f0b8244..94cbfff 100644 --- a/doc/fping.pod +++ b/doc/fping.pod @@ -135,6 +135,10 @@ Set the "Don't Fragment" bit in the IP header (used to determine/test the MTU). Same as -d. +=item B<-N> + +Format output for netdata (-l -Q are required). See: http://my-netdata.io/ + =item B<-o> Calculate "outage time" based on the number of lost pings and the interval used (useful for network convergence tests). From f9579bda3f074280fb9ba3148ff83319839d7311 Mon Sep 17 00:00:00 2001 From: David Schweikert Date: Wed, 11 Jan 2017 09:50:04 +0100 Subject: [PATCH 3/4] prepare v3.15 --- ChangeLog | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ChangeLog b/ChangeLog index 2168ae9..f69bcb8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2017-01-11 David Schweikert + * Version 3.15 + * (bugfix) Fix compiler errors on platforms other than Linux (related + to the new -M option, #109) + * Test suite fixes for macOS + 2017-01-10 David Schweikert * Version 3.14 * (feature) Ignore network and broadcast for cidrs /31 and /32 (#102, Martin Topholm) From 194325e167c5991e63ab729defd0a7fb3dba1d92 Mon Sep 17 00:00:00 2001 From: David Schweikert Date: Wed, 11 Jan 2017 09:51:35 +0100 Subject: [PATCH 4/4] prepare v3.15 --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index d04e954..9b7beca 100644 --- a/configure.ac +++ b/configure.ac @@ -3,7 +3,7 @@ dnl Process this file with autoconf to produce a configure script. dnl Minimum Autoconf version required. AC_PREREQ(2.59) -AC_INIT([fping],[3.14]) +AC_INIT([fping],[3.15]) dnl make ipv4 and ipv6 options AC_ARG_ENABLE([ipv4],