Nmap Development mailing list archives

Re: getinterfaces on NetBSD


From: Fredrik Pettai <pettai () nordu net>
Date: Thu, 25 Mar 2010 23:31:19 +0100

On Mar 25, 2010, at 10:03 PM, David Fifield wrote:
On Tue, Mar 23, 2010 at 06:22:26PM +0100, Fredrik Pettai wrote:
bash-4.0# nmap --iflist

Starting Nmap 5.21 ( http://nmap.org ) at 2010-03-23 18:03 CET
INTERFACES: NONE FOUND(!)
WARNING: Unable to find appropriate interface for system route to
193.10.5.1
WARNING: Unable to find appropriate interface for system route to
127.0.0.1
WARNING: Unable to find appropriate interface for system route to
127.0.0.1
ROUTES: NONE FOUND(!)

I can reproduce this now on NetBSD. I found that this has been reported
before: http://seclists.org/nmap-dev/2009/q3/749. This revealed that
there is a NetBSD patch in the pkgsrc tree, at

http://cvsweb.se.netbsd.org/cgi-bin/bsdweb.cgi/pkgsrc/net/nmap/patches/patch-ad?rev=1.13;content-type=text%2Fplain

The important issue is probably not Nmap 5.00 versus 5.21, but patched
versus non-patched. Applying the patch fixes the problem for me. A newer
revision of the patch,

http://cvsweb.se.netbsd.org/cgi-bin/bsdweb.cgi/pkgsrc/net/nmap/patches/patch-ad?rev=1.14;content-type=text%2Fplain

looks wrong to me. The line
+    len = ifr->ifr_addr.sa_len > sizeof(ifr->ifr_name);
should instead be
+    if (ifr->ifr_addr.sa_len > sizeof(ifr->ifr_ifru))

That's funny, I was just sitting and looking thru the patches myself and also found that (embracing) mistake.

Incidentally, Fredrik, I see the name "pettai" in the pkgsrc tree; are
you maintaining Nmap for NetBSD now?

I don't maintain it, but I committed that (broken) patch :-( I made a correct patch before, but somehow screwed up the one sent in to be committed. Since nmap compiled fine and ran fine as an unprivileged user (unless you used --iflist), so I didn't notice it myself.

I just changed the patch, and yes, it works as expected. I've also flagged that I want to commit the correction into pkgsrc.

btw. maybe this page should be updated: http://nmap.org/book/inst-bsd.html
Now OpenBSD is the one with the oldest distribution of Nmap :-)

Thanks,
/P
_______________________________________________
Sent through the nmap-dev mailing list
http://cgi.insecure.org/mailman/listinfo/nmap-dev
Archived at http://seclists.org/nmap-dev/


Current thread: