Skip to content

Commit

Permalink
Fix the check for pcap_set_immediate_mode, which was failing every time.
Browse files Browse the repository at this point in the history
  • Loading branch information
bonsaiviking committed Oct 4, 2018
1 parent 30db709 commit e483615
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 4 deletions.
8 changes: 4 additions & 4 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ o [NSE] Completely removed the bit.lua NSE library. All of its functions are
replaced by native Lua bitwise operations, except for `arshift` (arithmetic
shift) which has been moved to the bits.lua library. [Daniel Miller]

o [GH#1291][GH#34] Use pcap_create instead of pcap_live_open in Nmap, and set
immediate mode on the pcap descriptor. This solves packet loss problems on
Linux and may improve performance on other platforms. [Daniel Cater, Mike
Pontillo, Daniel Miller]
o [GH#1291][GH#34][GH#1339] Use pcap_create instead of pcap_live_open in Nmap,
and set immediate mode on the pcap descriptor. This solves packet loss
problems on Linux and may improve performance on other platforms.
[Daniel Cater, Mike Pontillo, Daniel Miller]

o [GH#1150] Start host timeout clocks when the first probe is sent to a host,
not when the hostgroup is started. Sometimes a host doesn't get probes until
Expand Down
5 changes: 5 additions & 0 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -6418,6 +6418,9 @@ $as_echo "#define HAVE_PCAP_SET_IMMEDIATE_MODE 1" >>confdefs.h

else
# We assume our included libpcap doesn't need this check-and-define
# link with -lpcap for the purposes of this test
LIBS_OLD="$LIBS"
LIBS="$LIBS -lpcap"

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if PCAP_NETMASK_UNKNOWN is defined/handled by libpcap" >&5
$as_echo_n "checking if PCAP_NETMASK_UNKNOWN is defined/handled by libpcap... " >&6; }
Expand Down Expand Up @@ -6466,6 +6469,8 @@ _ACEOF
fi
done

# Restore libs
LIBS="$LIBS_OLD"


$as_echo "#define HAVE_LIBPCAP 1" >>confdefs.h
Expand Down
5 changes: 5 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -482,8 +482,13 @@ if test $have_libpcap != yes; then
AC_DEFINE(HAVE_PCAP_SET_IMMEDIATE_MODE, 1, [Included libpcap has pcap_set_immediate_mode])
else
# We assume our included libpcap doesn't need this check-and-define
# link with -lpcap for the purposes of this test
LIBS_OLD="$LIBS"
LIBS="$LIBS -lpcap"
PCAP_DEFINE_NETMASK_UNKNOWN
AC_CHECK_FUNCS([pcap_set_immediate_mode])
# Restore libs
LIBS="$LIBS_OLD"

AC_DEFINE(HAVE_LIBPCAP, 1, [Have libpcap library])
LIBPCAP_LIBS="-lpcap"
Expand Down
5 changes: 5 additions & 0 deletions nsock/src/configure
Original file line number Diff line number Diff line change
Expand Up @@ -3643,6 +3643,9 @@ if test "$with_libpcap" != "no" -a "$have_libpcap" = "no"; then
$as_echo "#define HAVE_PCAP_SET_IMMEDIATE_MODE 1" >>confdefs.h
else
# link with -lpcap for the purposes of this test
LIBS_OLD="$LIBS"
LIBS="$LIBS -lpcap"
for ac_func in pcap_set_immediate_mode
do :
ac_fn_c_check_func "$LINENO" "pcap_set_immediate_mode" "ac_cv_func_pcap_set_immediate_mode"
Expand All @@ -3654,6 +3657,8 @@ _ACEOF
fi
done
# Restore libs
LIBS="$LIBS_OLD"
fi
if test "$have_libpcap" != "no"; then
Expand Down
5 changes: 5 additions & 0 deletions nsock/src/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,12 @@ if test "$with_libpcap" != "no" -a "$have_libpcap" = "no"; then
have_libpcap=yes
AC_DEFINE(HAVE_PCAP_SET_IMMEDIATE_MODE, 1, [Included libpcap has pcap_set_immediate_mode])
else
# link with -lpcap for the purposes of this test
LIBS_OLD="$LIBS"
LIBS="$LIBS -lpcap"
AC_CHECK_FUNCS([pcap_set_immediate_mode])
# Restore libs
LIBS="$LIBS_OLD"
fi

if test "$have_libpcap" != "no"; then
Expand Down

0 comments on commit e483615

Please sign in to comment.