Nmap Development mailing list archives

Re: [PATCH] Traceroute failure under FreeBSD


From: David Fifield <david () bamsoftware com>
Date: Sun, 27 Sep 2009 12:14:03 -0600

On Sun, Sep 27, 2009 at 06:16:58PM +0200, Henri Doreau wrote:
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;

Thank you, the patch looks good and I have applied it. Thank you for
solving this--Chris Clements reported the same bug to me after the patch
of http://seclists.org/nmap-dev/2009/q3/1055.html. I had thought the two
issues were related but they weren't.

David Fifield

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


Current thread: