Nmap Development mailing list archives

Re: Compile error on netbsd


From: Jay Fink <jay.fink () gmail com>
Date: Mon, 31 Aug 2009 14:46:46 -0400

Your right - char * works fine; the first time I tried this I don't
think I waited long enough.
Check this out:

colico$ time ./nmap localhost

Starting Nmap 5.05BETA1 ( http://nmap.org ) at 2009-08-31 09:36 EST
Interesting ports on localhost (127.0.0.1):
Not shown: 999 closed ports
PORT   STATE SERVICE
22/tcp open  ssh

Nmap done: 1 IP address (1 host up) scanned in 18.29 seconds
       18.32 real         0.28 user         0.07 sys

Same code on osX:

[14:36:36 :~/src/nmap]$ time ./nmap localhost

Starting Nmap 5.05BETA1 ( http://nmap.org ) at 2009-08-31 14:36 EDT
Interesting ports on localhost (127.0.0.1):
Not shown: 998 closed ports
PORT    STATE SERVICE
22/tcp  open  ssh
631/tcp open  ipp

Nmap done: 1 IP address (1 host up) scanned in 6.56 seconds

real    0m6.743s
user    0m0.185s
sys     0m0.206s


On Mon, Aug 31, 2009 at 1:44 PM, David Fifield<david () bamsoftware com> wrote:
On Mon, Aug 31, 2009 at 09:13:15AM -0400, Jay Fink wrote:
I tried a few different approaches this morning and of course - the
simplest one worked :-)
I want to test this in a few places first but this gets nmap-current
to work on netbsd 5.99.X.
So far I have tested on osX (darwin 9.7.0) - this evening I will test
on freebsd 7, 8 and debian-current.

I will look into the sed issue afterward.

thanks,
  j

--- tcpip.cc.orig     2009-08-31 08:59:30.000000000 -0400
+++ tcpip.cc  2009-08-31 09:10:28.000000000 -0400
@@ -3037,7 +3037,7 @@
   ifr = ifc.ifc_req;

   for (ifr = ifc.ifc_req;
-       ifr && ifr->ifr_name[0] && (void *) ifr < ifc.ifc_buf + ifc.ifc_len;
+       ifr && ifr->ifr_name[0] && (void *) ifr < (caddr_t) ifc.ifc_buf + ifc.ifc_len;
        ifr = (struct ifreq *) ((char *) ifr + len)) {
     struct sockaddr_in *sin;
     struct ifreq tmpifr;

I don't understand. How is that any different from this patch, which you
said didn't work?

http://seclists.org/nmap-dev/2009/q3/0800.html

Isn't caddr_t the same as char * on your platform? I would rather use
char * here because it makes it clear we're doing single-byte-aligned
pointer arithmetic.

David Fifield


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


Current thread: