1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-15 20:29:03 +00:00

Add implicitARPPing option to NmapOps.

This commit is contained in:
david
2012-07-16 18:11:20 +00:00
parent bbea3dc088
commit 31bbb65c07
3 changed files with 12 additions and 4 deletions

View File

@@ -319,6 +319,7 @@ void NmapOps::Initialize() {
deprecated_xml_osclass = false;
resolve_all = 0;
dns_servers = NULL;
implicitARPPing = true;
numhosts_scanned = 0;
numhosts_up = 0;
numhosts_scanning = 0;

View File

@@ -321,6 +321,13 @@ class NmapOps {
int resolve_all;
char *dns_servers;
/* Do IPv4 ARP or IPv6 ND scan of directly connected Ethernet hosts, even if
non-ARP host discovery options are used? This is normally more efficient,
not only because ARP/ND scan is faster, but because we need the MAC
addresses provided by ARP or ND scan in order to do IP-based host discovery
anyway. But when a network uses proxy ARP, all hosts will appear to be up
unless you do an IP host discovery on them. This option is true by default. */
bool implicitARPPing;
// If true, write <os><osclass/><osmatch/></os> as in xmloutputversion 1.03
// rather than <os><osmatch><osclass/></osmatch></os> as in 1.04 and later.

View File

@@ -440,7 +440,8 @@ batchfull:
if (hs->hostbatch[0]->ifType() == devt_ethernet &&
hs->hostbatch[0]->af() == AF_INET &&
hs->hostbatch[0]->directlyConnected() &&
o.sendpref != PACKET_SEND_IP_STRONG) {
o.sendpref != PACKET_SEND_IP_STRONG &&
o.implicitARPPing) {
arpping(hs->hostbatch, hs->current_batch_sz);
arpping_done = true;
}
@@ -450,7 +451,8 @@ batchfull:
if (hs->hostbatch[0]->ifType() == devt_ethernet &&
hs->hostbatch[0]->af() == AF_INET6 &&
hs->hostbatch[0]->directlyConnected() &&
o.sendpref != PACKET_SEND_IP_STRONG) {
o.sendpref != PACKET_SEND_IP_STRONG &&
o.implicitARPPing) {
arpping(hs->hostbatch, hs->current_batch_sz);
arpping_done = true;
}
@@ -469,8 +471,6 @@ batchfull:
}
}
/* TODO: Maybe I should allow real ping scan of directly connected
ethernet hosts? */
/* Then we do the mass ping (if required - IP-level pings) */
if ((pingtype == PINGTYPE_NONE && !arpping_done) || hs->hostbatch[0]->ifType() == devt_loopback) {
for (i=0; i < hs->current_batch_sz; i++) {