1
0
mirror of https://github.com/nmap/nmap.git synced 2026-02-11 16:06:33 +00:00

Check for target->deviceName == NULL in target_needs_new_hostgroup in

targets.cc, and return false if it is so. This indicates that we are not
doing a raw scan. target->deviceName != NULL is necessary before
checking target->directlyConnected(), otherwise you get this assertion
failure when doing any non-root scan (such as -sT or -sL) as root with
two or more targets:

nmap: Target.cc:369: bool Target::directlyConnected() const: Assertion `directly_connected == 0 || directly_connected == 1' failed.
Aborted

This is how the logic originally worked, and I accidentally broke it in
r17892.
This commit is contained in:
david
2010-06-25 05:34:08 +00:00
parent edfc8a1ec0
commit 77df357acd

View File

@@ -382,12 +382,11 @@ static bool target_needs_new_hostgroup(const HostGroupState *hs, const Target *t
return false;
/* There are no restrictions on non-root scans. */
if (!(o.af() == AF_INET && o.isr00t))
if (!(o.af() == AF_INET && o.isr00t && target->deviceName() != NULL))
return false;
/* Different interface name? */
if (hs->hostbatch[0]->deviceName() != NULL &&
target->deviceName() != NULL &&
strcmp(hs->hostbatch[0]->deviceName(), target->deviceName()) != 0) {
return true;
}