Nmap Development mailing list archives

Re: MinGW patch, getaddrinfo


From: Gisle Vanem <gvanem () broadpark no>
Date: Thu, 04 Sep 2008 15:33:23 +0200

"David Fifield" <david () bamsoftware com> wrote:

It looks good. Is _MSC_VER the most reliable way to check for the
existence of the header? I ask only because I found
http://www.tremfusion.net/trac/changeset/443 which uses __MINGW32__ to
do the same thing.

I attached nbase-wspiapi-mingw.diff that does what you ask in a
different fashion, defining HAVE_WSPIAPI_H based on the value of
_MSC_VER. Please try it and if it works I'll apply it.

It looks good. Please commit.

I see two other places where getaddrinfo is used, so I'm curious why
only this one needs to be patched. What happens when you run

nmap -6 -S ::1 localhost

It works as expected. I.e. returns WSAEAFNOSUPPORT (incompatible address).
So it don't crash there.

And what happens when you script scan one of the targets that requires
the above patch? There is a call to getaddrinfo in nse_nsock too.

I failed to follow the codepath into those other getaddrinfo() calls.
Hint for you; patch nbase/getaddrinfo.c to set rc==0 and result==NULL
and test.
--gv

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


Current thread: