From 5ab1b23bf03da57b77dd6e8aea59d32150d4fc2b Mon Sep 17 00:00:00 2001 From: david Date: Fri, 17 May 2013 07:56:51 +0000 Subject: [PATCH] Fix address matching in -PY ping. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Patch by Marin Maržić. http://seclists.org/nmap-dev/2013/q2/297 --- CHANGELOG | 2 ++ scan_engine.cc | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index 44c548456..f3dded023 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,7 @@ # Nmap Changelog ($Id$); -*-text-*- +o Fixed address matching for SCTP (-PY) ping. [Marin Maržić] + o Removed some non-ANSI-C strftime format strings ("%F") and locale-dependent formats ("%c") from NSE scripts and libraries. C99-specified %F was noticed by Alex Weber. [Daniel Miller] diff --git a/scan_engine.cc b/scan_engine.cc index 74f869ac2..c712d7254 100644 --- a/scan_engine.cc +++ b/scan_engine.cc @@ -5317,7 +5317,7 @@ static int get_ping_pcap_result(UltraScanInfo *USI, struct timeval *stime) { /* Ensure the connection info matches. */ if (probe->dport() != ntohs(sctp->sh_sport) || probe->sport() != ntohs(sctp->sh_dport) || - sockaddr_storage_cmp(&target_src, &hdr.dst) == 0) + sockaddr_storage_cmp(&target_src, &hdr.dst) != 0) continue; /* Sometimes we get false results when scanning localhost with