mirror of
https://github.com/nmap/nmap.git
synced 2026-05-13 08:46:45 +00:00
Enable Nmap, Nping to use Npcap over Winpcap if available.
This commit is contained in:
parent
7a9ab13bee
commit
67fd101b01
11 changed files with 233 additions and 22 deletions
10
FPEngine.cc
10
FPEngine.cc
|
|
@ -133,6 +133,10 @@
|
|||
#include "linear.h"
|
||||
#include "FPModel.h"
|
||||
extern NmapOps o;
|
||||
#ifdef WIN32
|
||||
/* from libdnet's intf-win32.c */
|
||||
extern "C" int g_has_npcap_loopback;
|
||||
#endif
|
||||
|
||||
#include <math.h>
|
||||
|
||||
|
|
@ -211,7 +215,11 @@ void FPNetworkControl::init(const char *ifname, devtype iftype) {
|
|||
this->nsock_init = true;
|
||||
|
||||
/* Obtain raw socket or check that we can obtain an eth descriptor. */
|
||||
if ((o.sendpref & PACKET_SEND_ETH) && iftype == devt_ethernet && ifname != NULL) {
|
||||
if ((o.sendpref & PACKET_SEND_ETH) && (iftype == devt_ethernet
|
||||
#ifdef WIN32
|
||||
|| (g_has_npcap_loopback && iftype == devt_loopback)
|
||||
#endif
|
||||
) && ifname != NULL) {
|
||||
/* We don't need to store the eth handler because FPProbes come with a
|
||||
* suitable one (FPProbes::getEthernet()), we just attempt to obtain one
|
||||
* to see if it fails. */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue