Nmap Development mailing list archives

[PATCH] Traceroute failure under FreeBSD


From: Henri Doreau <henri.doreau () gmail com>
Date: Sun, 27 Sep 2009 18:16:58 +0200

Hello,

Nmap used to die after a traceroute under my FreeBSD 7.2-RELEASE-p2 in the
Target::GenerateIPString method with the following message :

# nmap -sP --traceroute scanme.insecure.org

Starting Nmap 5.05BETA1 ( http://nmap.org ) at 2009-09-27 17:41 CEST
Failed to convert target address to presentation format!?! Error: Address
family not supported by protocol family
QUITTING!

This was due to the fact inet_ntop() was called with its first argument set
to zero (which is neither the value of AF_INET nor AF_INET6). This zero
seemed to come from the initialization of a sockaddr_in structure
(traceroute.cc:1280 struct sockaddr_in sin = {AF_INET};)

Attached is a trivial patch that fix the bug by explicitly initializing the
sin_family field of the structure;

Cheers

Henri

Attachment: traceroute.cc.patch
Description:


_______________________________________________
Sent through the nmap-dev mailing list
http://cgi.insecure.org/mailman/listinfo/nmap-dev
Archived at http://SecLists.Org

Current thread: