mirror of
https://github.com/nmap/nmap.git
synced 2026-08-04 06:40:48 +00:00
Move the IP ID test after the tests for source ports, etc., because
every false attempt degrades the IP ID filter. We only want to to call it when we're pretty sure we have a match.
This commit is contained in:
parent
d00a574ae0
commit
af8f151972
1 changed files with 4 additions and 4 deletions
|
|
@ -4248,10 +4248,6 @@ static bool get_pcap_result(UltraScanInfo *USI, struct timeval *stime) {
|
|||
hss->target->v4hostip()->s_addr != ip2->ip_dst.s_addr)
|
||||
continue;
|
||||
|
||||
/* Checking IPID is a little more complex because you can't always count on it */
|
||||
if (!allow_ipid_match(probe->ipid(), ntohs(ip2->ip_id)))
|
||||
continue;
|
||||
|
||||
if (ip2->ip_p == IPPROTO_TCP && !USI->prot_scan) {
|
||||
struct tcp_hdr *tcp = (struct tcp_hdr *) ((u8 *) ip2 + ip2->ip_hl * 4);
|
||||
if (ntohs(tcp->th_sport) != probe->sport() ||
|
||||
|
|
@ -4273,6 +4269,10 @@ static bool get_pcap_result(UltraScanInfo *USI, struct timeval *stime) {
|
|||
assert(0);
|
||||
}
|
||||
|
||||
/* Checking IPID is a little more complex because you can't always count on it */
|
||||
if (!allow_ipid_match(probe->ipid(), ntohs(ip2->ip_id)))
|
||||
continue;
|
||||
|
||||
if (icmp->icmp_type == 3) {
|
||||
switch(icmp->icmp_code) {
|
||||
case 0: /* Network unreachable */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue