From 4a491e35d87f721ba518fe6e7c93f031b1349663 Mon Sep 17 00:00:00 2001 From: dmiller Date: Tue, 7 Apr 2015 21:31:06 +0000 Subject: [PATCH] Check address family before loading OS fingerprints In addition to silencing an unnecessary fatal error when nmap-os-db is not found but user has requested -6, this should make start times a bit more efficient, since only 1 or the other database is loaded. Patch by Alexandru Geana Fixes #97 --- nmap.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/nmap.cc b/nmap.cc index ba0c6d83c..21542fe99 100644 --- a/nmap.cc +++ b/nmap.cc @@ -1426,8 +1426,10 @@ void apply_delayed_options() { if (o.osscan) { - o.reference_FPs = parse_fingerprint_reference_file("nmap-os-db"); - o.os_labels_ipv6 = load_fp_matches(); + if (o.af() == AF_INET) + o.reference_FPs = parse_fingerprint_reference_file("nmap-os-db"); + else if (o.af() == AF_INET6) + o.os_labels_ipv6 = load_fp_matches(); } // Must check and change this before validate_scan_lists