mirror of
https://github.com/nmap/nmap.git
synced 2026-01-09 16:09:03 +00:00
Remove a test for validity of received ICMP packets that was no longer correct.
In r8541 readip_pcap was given the ability to validate packets, and it also returns a different length in some cases than it used to: + /* OK, since the IP header has been validated, we don't want to tell + * the caller they have more packet than they really have. This can + * be caused by the Ethernet CRC trailer being counted, for example. + */ + if (*len > ntohs(iphdr->ip_len)) + *len = ntohs(iphdr->ip_len); which made some tests having to do with packet length invalid. They were removed but this one was missed.
This commit is contained in:
@@ -3714,10 +3714,6 @@ static bool get_pcap_result(UltraScanInfo *USI, struct timeval *stime) {
|
||||
goodone = true;
|
||||
}
|
||||
} else if (ip->ip_p == IPPROTO_ICMP) {
|
||||
|
||||
if ((unsigned) ip->ip_hl * 4 + 28 > bytes)
|
||||
continue;
|
||||
|
||||
icmp = (struct icmp *) ((char *)ip + 4 * ip->ip_hl);
|
||||
|
||||
if (icmp->icmp_type != 3)
|
||||
|
||||
Reference in New Issue
Block a user