From 40ae30f600db465f40cf8a9bddcb94713a4b385a Mon Sep 17 00:00:00 2001 From: david Date: Fri, 11 Jul 2008 00:52:55 +0000 Subject: [PATCH] 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. --- scan_engine.cc | 4 ---- 1 file changed, 4 deletions(-) diff --git a/scan_engine.cc b/scan_engine.cc index c1eaf6a4e..3947479a4 100644 --- a/scan_engine.cc +++ b/scan_engine.cc @@ -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)