sync with develop

pull/89/merge
David Schweikert 8 years ago
parent c5612265ae
commit 9787dd0136

@ -1,18 +1,28 @@
Unreleased Unreleased
* INCOMPATIBILITY WARNING: * INCOMPATIBILITY WARNING:
fping and fping6 are now unified into one binary. This means that for fping and fping6 are now unified into one binary. This means that, for
example doing 'fping www.google.com' is going to ping the IPv6 IP of example, doing 'fping www.google.com' is going to ping the IPv6 IP of
www.google.com on IPv6-enabled hosts. If you need exact compatibility with www.google.com on IPv6-enabled hosts.
old versions, you can:
- compile fping with --disable-ipv6 (or use a wrapper, and call 'fping -4')
- compile fping with --enable-ipv6 and rename it to fping6 (same as 'fping -6')
If you need exact compatibility with old versions, you can configure,
compile, and install fping twice: once for ipv4 and once for ipv6:
- ./configure --disable-ipv6; make clean install
- ./configure --disable-ipv4 --program-suffix=6; make clean install
Or, alternatively, you could write two wrappers 'fping' and 'fping6',
that set respectively the options '-4' and '-6' when calling the original
fping binary.
* Version 4.0
* (feature) Unified 'fping' and 'fping6' into one binary (#80) * (feature) Unified 'fping' and 'fping6' into one binary (#80)
* (feature) --enable-ipv6 is now default
* (feature) New option '-4' to force IPv4 * (feature) New option '-4' to force IPv4
* (feature) New option '-6' to force IPv6 * (feature) New option '-6' to force IPv6
2017-02-09 David Schweikert <david@schweikert.ch>
* Version 3.16
* (feature) Support kernel-timestamping of received packets (#46) * (feature) Support kernel-timestamping of received packets (#46)
* (feature) Simplify restrictions: only -i >= 1 and -p >= 10 are enforced now * (feature) Simplify restrictions: only -i >= 1 and -p >= 10 are enforced now
* (feature) --enable-ipv6 is now default (you can use --disable-ipv6 to disable IPv6 support)
* (bugfix) Fix option -m to return all IPs of a hostname * (bugfix) Fix option -m to return all IPs of a hostname
* (bugfix) Fix option -H (ttl) for IPv6 * (bugfix) Fix option -H (ttl) for IPv6
* (bugfix) Fix option -M (don't fragment) for IPv6 * (bugfix) Fix option -M (don't fragment) for IPv6

@ -1,5 +0,0 @@
- implement -4
- implement -6
- test -4
- test -6
- fix -m

@ -10,9 +10,9 @@ set -e
# exit 0 # exit 0
#fi #fi
# do this only for the master branch # do this only for the master and version3 branch
if [ "$TRAVIS_BRANCH" != "master" ]; then if [ "$TRAVIS_BRANCH" != "master" -a "$TRAVIS_BRANCH" != "version3" ]; then
echo "skipped upload branch $TRAVIS_BRANCH isn't master" echo "skipped upload branch $TRAVIS_BRANCH isn't master/version3"
exit 0 exit 0
fi fi

@ -31,7 +31,7 @@ $cmd->stderr_is_eq("");
my $cmd = Test::Command->new(cmd => "fping -4 ::1"); my $cmd = Test::Command->new(cmd => "fping -4 ::1");
$cmd->exit_is_num(2); $cmd->exit_is_num(2);
$cmd->stdout_is_eq(""); $cmd->stdout_is_eq("");
$cmd->stderr_is_eq("::1: Address family for hostname not supported\n"); $cmd->stderr_like(qr{^::1:.*(not supported|not known)});
} }
# fping -6 # fping -6
@ -49,7 +49,7 @@ SKIP: {
my $cmd = Test::Command->new(cmd => "fping -6 127.0.0.1"); my $cmd = Test::Command->new(cmd => "fping -6 127.0.0.1");
$cmd->exit_is_num(2); $cmd->exit_is_num(2);
$cmd->stdout_is_eq(""); $cmd->stdout_is_eq("");
$cmd->stderr_is_eq("127.0.0.1: Address family for hostname not supported\n"); $cmd->stderr_like(qr{127\.0\.0\.1:.*(not supported|not known)});
} }
# fping -a # fping -a

@ -1,6 +1,7 @@
#!/usr/bin/perl -w #!/usr/bin/perl -w
use Test::Command tests => 7; use Test::Command tests => 7;
use Test::More;
# -i n interval between sending ping packets (in millisec) (default 25) # -i n interval between sending ping packets (in millisec) (default 25)
# -l loop sending pings forever # -l loop sending pings forever
@ -24,7 +25,10 @@ $cmd->stdout_like(qr{127\.0\.0\.1 : \[0\], 84 bytes, 0\.\d+ ms \(0.\d+ avg, 0% l
} }
# fping -M # fping -M
{ SKIP: {
if($^O eq 'darwin') {
skip '-M option not supported on macOS', 3;
}
my $cmd = Test::Command->new(cmd => "fping -M 127.0.0.1"); my $cmd = Test::Command->new(cmd => "fping -M 127.0.0.1");
$cmd->exit_is_num(0); $cmd->exit_is_num(0);
$cmd->stdout_is_eq("127.0.0.1 is alive\n"); $cmd->stdout_is_eq("127.0.0.1 is alive\n");

@ -72,7 +72,10 @@ $cmd->stderr_is_eq("");
} }
# fping -M # fping -M
{ SKIP: {
if($^O eq 'darwin') {
skip '-M option not supported on macOS', 3;
}
my $cmd = Test::Command->new(cmd => "fping -r 0 -b 10000 -M 8.8.8.8"); my $cmd = Test::Command->new(cmd => "fping -r 0 -b 10000 -M 8.8.8.8");
$cmd->exit_is_num(1); $cmd->exit_is_num(1);
$cmd->stdout_is_eq("8.8.8.8 is unreachable\n"); $cmd->stdout_is_eq("8.8.8.8 is unreachable\n");

@ -5,23 +5,36 @@ AC_PREREQ(2.59)
AC_INIT([fping],[3.16-rc2]) AC_INIT([fping],[3.16-rc2])
dnl make ipv4 and ipv6 options dnl --disable-ipv4
AC_ARG_ENABLE([ipv4], AC_ARG_ENABLE([ipv4],
AS_HELP_STRING([--enable-ipv4], [(ignored for compatibility with previous versions)])) AS_HELP_STRING([--disable-ipv4], [Disable support for pinging IPv4 hosts]))
AM_CONDITIONAL([IPV4], [test "x$enable_ipv4" != "xno"])
AM_COND_IF([IPV4], [AC_DEFINE([IPV4], [1], [IPv4 enabled])])
dnl --disable-ipv6
AC_ARG_ENABLE([ipv6], AC_ARG_ENABLE([ipv6],
AS_HELP_STRING([--enable-ipv6], [Build IPv6 capable fping6]), AS_HELP_STRING([--disable-ipv6], [Disable support for pinging IPv6 hosts]))
[case "${enableval}" in AS_IF([test "x$enable_ipv6" != "xno"], [
yes) ipv6=true ;; dnl Test if IPv6 is supported
no) ipv6=false ;; AC_CHECK_HEADERS([netinet/icmp6.h], [have_ipv6="yes"], [], [[
*) AC_MSG_ERROR([bad value ${enableval} for --enable-ipv6]) ;; #include <netinet/in.h>
esac],[ipv6=true]) ]])
AM_CONDITIONAL([IPV6], [test x$ipv6 = xtrue]) ])
dnl Can't disable both IPv4 and IPv6
AS_IF([test "x$enable_ipv4" = "xno" -a "x$enable_ipv6" = "xno"], [
AC_MSG_ERROR([Need to enable IPv4 or IPv6. Can't disable both!)])
])
dnl IPv6 required, but not supported?
AS_IF([test \( "x$enable_ipv6" = "xyes" -o "x$enable_ipv4" = "xno" \) -a "x$have_ipv6" != "xyes" ], [
AC_MSG_ERROR([IPv6 not supported on this platform (netinet/icmp6.h header not found)])
])
AM_CONDITIONAL([IPV6], [test "x$have_ipv6" = "xyes"])
AM_COND_IF([IPV6], [AC_DEFINE([IPV6], [1], [IPv6 enabled])])
AC_ARG_ENABLE([timestamp], AC_ARG_ENABLE([timestamp],
AS_HELP_STRING([--disable-timestamp], [Disable kernel-based packet timestaping (SO_TIMESTAMP)])) AS_HELP_STRING([--disable-timestamp], [Disable kernel-based packet timestaping (SO_TIMESTAMP)]))
AS_IF([test "x$enable_timestamp" != "xno"], [ AS_IF([test "x$enable_timestamp" != "xno"], [
AC_CHECK_DECL([SO_TIMESTAMP], [AC_DEFINE(HAVE_SO_TIMESTAMP, [1], [set define])], [have_so_timestamp="no"], [#include <sys/types.h> AC_CHECK_DECL([SO_TIMESTAMP], [AC_DEFINE(HAVE_SO_TIMESTAMP, [1], [SO_TIMESTAMP is defined])], [have_so_timestamp="no"], [#include <sys/types.h>
#include <sys/socket.h>]) #include <sys/socket.h>])
]) ])
dnl Test if --enable-timestamp is explicitely enabled and make an error if this platform doesn't support it dnl Test if --enable-timestamp is explicitely enabled and make an error if this platform doesn't support it
@ -70,7 +83,7 @@ AH_BOTTOM([
]) ])
dnl Checks for header files. dnl Checks for header files.
AC_CHECK_HEADERS(unistd.h sys/file.h stdlib.h sys/select.h) AC_CHECK_HEADERS([unistd.h sys/file.h stdlib.h sys/select.h])
AC_CONFIG_FILES([Makefile AC_CONFIG_FILES([Makefile
doc/Makefile doc/Makefile

@ -1,15 +1,6 @@
man_MANS = man_MANS = fping.8
man_MANS += fping.8 EXTRA_DIST = fping.8 fping.pod README.1992
if IPV6
man_MANS += fping6.8
endif
EXTRA_DIST = fping.8 fping6.8 fping.pod README.1992
fping.8: fping.pod fping.8: fping.pod
pod2man -c "" -s 8 -r "fping" $< >$@ pod2man -c "" -s 8 -r "fping" $< >$@
fping6.8: fping.pod
pod2man -c "" -s 8 -r "fping" -n fping6 $< >$@

@ -0,0 +1 @@
BasedOnStyle: WebKit

@ -8,6 +8,4 @@ fping_DEPENDENCIES = ../config.h
if IPV6 if IPV6
fping_SOURCES += socket6.c fping_SOURCES += socket6.c
fping_CFLAGS = $(AM_CFLAGS) -DIPV6 fping_CFLAGS = $(AM_CFLAGS) -DIPV6
install-exec-hook:
ln -s fping$(EXEEXT) $(DESTDIR)$(sbindir)/fping6
endif endif

File diff suppressed because it is too large Load Diff

@ -36,11 +36,11 @@
*/ */
#include "seqmap.h" #include "seqmap.h"
#include "options.h"
#include "limits.h" #include "limits.h"
#include "options.h"
#include <stdlib.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h>
/* description of the data structure used: /* description of the data structure used:
* *

@ -30,19 +30,19 @@
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/ */
#include "fping.h"
#include "config.h" #include "config.h"
#include "fping.h"
#include <sys/socket.h> #include <fcntl.h>
#include <netdb.h>
#include <netinet/in.h> #include <netinet/in.h>
#include <netinet/ip.h>
#include <netinet/in_systm.h> #include <netinet/in_systm.h>
#include <netinet/ip.h>
#include <netinet/ip_icmp.h> #include <netinet/ip_icmp.h>
#include <netdb.h>
#include <stdio.h> #include <stdio.h>
#include <string.h>
#include <stdlib.h> #include <stdlib.h>
#include <fcntl.h> #include <string.h>
#include <sys/socket.h>
char* ping_buffer_ipv4 = 0; char* ping_buffer_ipv4 = 0;
size_t ping_pkt_size_ipv4; size_t ping_pkt_size_ipv4;

@ -30,16 +30,16 @@
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/ */
#include "fping.h"
#include "config.h" #include "config.h"
#include "fping.h"
#include <sys/socket.h> #include <fcntl.h>
#include <netinet/in.h>
#include <netdb.h> #include <netdb.h>
#include <netinet/in.h>
#include <stdio.h> #include <stdio.h>
#include <string.h>
#include <stdlib.h> #include <stdlib.h>
#include <fcntl.h> #include <string.h>
#include <sys/socket.h>
#include <netinet/icmp6.h> #include <netinet/icmp6.h>

Loading…
Cancel
Save