diff --git a/CHANGELOG b/CHANGELOG index b879839fc..d133a409d 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,10 @@ # Nmap Changelog ($Id$); -*-text-*- +o Targets requiring different source addresses now go into different + hostgroups, not only for host discovery but also for port scanning. + Before, only responses to one of the source addresses would be + processed, and the others would be ignored. [David] + o [NSE] Added script broadcast-wpad-discover which detects proxy servers on the network by using the Web Proxy Auto Discover Protocol (WPAD). [Patrik] diff --git a/nmap.cc b/nmap.cc index a5bbedd84..e0f6e252f 100644 --- a/nmap.cc +++ b/nmap.cc @@ -2057,7 +2057,8 @@ int nmap_main(int argc, char *argv[]) { /* Returns true iff this target is incompatible with the other hosts in the host group. This happens when: 1. it uses a different interface, or - 2. it has the same IP address as another target already in the group. + 2. it uses a different source address, or + 3. it has the same IP address as another target already in the group. These restrictions only apply for raw scans. This function is similar to one of the same name in targets.cc. That one is for ping scanning, this one is for port scanning. */ @@ -2076,6 +2077,10 @@ static bool target_needs_new_hostgroup(std::vector &targets, return true; } + /* Different source address? */ + if (sockaddr_storage_cmp(targets[0]->SourceSockAddr(), target->SourceSockAddr()) != 0) + return true; + /* Is there already a target with this same IP address? ultra_scan doesn't cope with that, because it uses IP addresses to look up targets from replies. What happens is one target gets the replies for all probes