Skip to content

Instantly share code, notes, and snippets.

@dmiller-nmap
Created June 6, 2015 21:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dmiller-nmap/d2ffd201159143c9ec20 to your computer and use it in GitHub Desktop.
Save dmiller-nmap/d2ffd201159143c9ec20 to your computer and use it in GitHub Desktop.
Patch to potentially solve nmap/nmap#154
diff --git a/scan_engine_raw.cc b/scan_engine_raw.cc
index 6d4b59a..40e0a2e 100644
--- a/scan_engine_raw.cc
+++ b/scan_engine_raw.cc
@@ -652,7 +652,8 @@ int get_ping_pcap_result(UltraScanInfo *USI, struct timeval *stime) {
sockaddr_storage_cmp(&target_src, &hdr.dst) != 0 ||
sockaddr_storage_cmp(&target_src, &encaps_hdr.src) != 0 ||
sockaddr_storage_cmp(&target_dst, &encaps_hdr.dst) != 0 ||
- ntohs(ping->id) != probe->icmpid())
+ ((probe->protocol() == IPPROTO_ICMP || probe->protocol() == IPPROTO_ICMPV6) &&
+ ntohs(ping->id) != probe->icmpid()))
continue;
if ((encaps_hdr.proto == IPPROTO_ICMP || encaps_hdr.proto == IPPROTO_ICMPV6)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment