From aba04241c7c24fa08ce29bc0d8a4ed5b1110ed6d Mon Sep 17 00:00:00 2001 From: David Schweikert Date: Wed, 1 Jan 2020 17:13:05 +0100 Subject: [PATCH] add _GNU_SOURCE to fix some warnings --- CHANGELOG.md | 3 ++- configure.ac | 1 + src/fping.c | 4 ++-- src/seqmap.c | 1 + 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1a80dc7..52128d9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,8 @@ UNRELEASED - Corrected long option name of -s to --stats (#148, thanks @wopfel) - Do not fail if using fping6 with -6 flag (#149, thanks @stromnet) -- Fail if interface binding (-I) does not work (#162, by @kbucheli) +- Fail if interface binding (-I) does not work (#162, thanks @kbucheli) +- Fix using option -4 when fping is compiled IPv4-only (#154, thanks @pbhenson) fping 4.2 (2019-02-19) ====================== diff --git a/configure.ac b/configure.ac index ce292ce..76b4c0d 100644 --- a/configure.ac +++ b/configure.ac @@ -4,6 +4,7 @@ dnl Minimum Autoconf version required. AC_PREREQ(2.59) AC_INIT([fping],[4.2]) +AC_GNU_SOURCE dnl --disable-ipv4 AC_ARG_ENABLE([ipv4], diff --git a/src/fping.c b/src/fping.c index d36d6c5..ea33767 100644 --- a/src/fping.c +++ b/src/fping.c @@ -34,6 +34,7 @@ extern "C" { #endif /* __cplusplus */ +#include "config.h" #include "fping.h" #include "options.h" #include "optparse.h" @@ -44,7 +45,6 @@ extern "C" { #include #include -#include "config.h" #include "seqmap.h" #ifdef HAVE_UNISTD_H @@ -608,7 +608,7 @@ int main(int argc, char** argv) break; case 'H': - if (!(ttl = (u_int)atoi(optparse_state.optarg))) + if (!(ttl = (unsigned int)atoi(optparse_state.optarg))) usage(1); break; diff --git a/src/seqmap.c b/src/seqmap.c index 3cff4c0..63f4178 100644 --- a/src/seqmap.c +++ b/src/seqmap.c @@ -35,6 +35,7 @@ * https://github.com/schweikert/fping/issues/48 */ +#include "config.h" #include "seqmap.h" #include "limits.h" #include "options.h"