Nmap Development mailing list archives

Patches to Nmap 5.30BETA1


From: Darren Reed <darren.reed () oracle com>
Date: Sat, 03 Apr 2010 00:19:59 -0700


Patches required to build on OpenSolaris with gmake 3.81


I hope I have fixed all of the cut-n-paste errors.

The common theme throughout is that our gmake seems to behave a lot differently to either the linux one or the makefiles are just broken. Either way, the changes below should work on all platforms.

I know it is bad form to patch "configure" but I don't know any other way to fix the detection of bpf here. The configure script is also wrong for many BSD's because NetBSD, etc, now only have /dev/bpf (a cloning device) and no longer have /dev/bpf0-15.

btw, I think I need to ask for guidance here...

OpenSolaris currently supports DLPI, PF_PACKET and BPF. DLPI will "work"
as it always has, but it is slow. With PF_PACKET some of the include paths
are different to Linux (there is no /usr/include/linux, for example) and
at present SIOCGIFHWADDR is only supported on PF_PACKET sockets (libdnet
usesSIOCGIFHWADDR on an AF_INET socket. The presence of BPF is taken to
indicate that the box is BSD and therefore the sysctl interface is used
to get the NIC address. The goal is to end up with nmap using BPF but
OpenSolaris isn't going to get sysctl any time soon. The next best
alternative seems to be supporting SIOCGIFHWADDR on AF_INET with
OpenSolaris and adapting the pcap/bpf part of nmap to use that ioctl
if it is present. Thoughts?

Darren

diff -u nmap-5.30BETA1/Makefile.in nmap-5.30BETA1.Solaris/Makefile.in
--- nmap-5.30BETA1/Makefile.in  Mon Mar 29 13:45:10 2010
+++ nmap-5.30BETA1.Solaris/Makefile.in  Thu Apr  1 03:34:08 2010
@@ -124,10 +124,10 @@

nsock_build: $(NSOCKDIR)/src/Makefile nbase_build
      @echo Compiling libnsock;
-       cd $(NSOCKDIR)/src && $(MAKE)
+       cd $(NSOCKDIR)/src && $(MAKE) NBASEDIR=../../nbase

ncat_build: $(NCATDIR)/Makefile nbase_build nsock_build $(NCATDIR)/ncat.h
-       cd $(NCATDIR) && $(MAKE)
+       cd $(NCATDIR) && $(MAKE) NBASEDIR=../nbase NSOCKDIR=../nsock/src

lua_build: $(LIBLUADIR)/Makefile
@echo Compiling liblua; cd $(LIBLUADIR) && $(MAKE) liblua.a CC="$(CC)" MYCFLAGS="$(CFLAGS) @LUA_CFLAGS@"
@@ -281,7 +281,7 @@
cd $(NDIFFDIR) && $(PYTHON) setup.py build $(if $(DESTDIR),--executable "$(DEFAULT_PYTHON_PATH)")

build-nping: $(NPINGDIR)/Makefile nbase_build nsock_build $(NPINGDIR)/nping.h
-       @cd $(NPINGDIR) && $(MAKE)
+       @cd $(NPINGDIR) && $(MAKE) NBASEDIR=../nbase NSOCKDIR=../nsock

install-ndiff:
cd $(NDIFFDIR) && $(PYTHON) setup.py install --prefix "$(prefix)" $(if $(DESTDIR),--root "$(DESTDIR)") diff -r -u nmap-5.30BETA1/libdnet-stripped/configure nmap-5.30BETA1.Solaris/libdnet-stripped/configure
--- nmap-5.30BETA1/libdnet-stripped/configure   Thu Jan 14 08:47:28 2010
+++ nmap-5.30BETA1.Solaris/libdnet-stripped/configure Thu Apr 1 03:10:16 2010
@@ -14341,7 +14341,7 @@
if test "${ac_cv_dnet_bsd_bpf+set}" = set; then $as_echo_n "(cached) " >&6
else
-  if test -c /dev/bpf0 ; then
+ if test -c /dev/bpf0 -o -e /dev/bpf; then ac_cv_dnet_bsd_bpf=yes
      else             ac_cv_dnet_bsd_bpf=no
diff -r -u nmap-5.30BETA1/ncat/Makefile.in nmap-5.30BETA1.Solaris/ncat/Makefile.in
--- nmap-5.30BETA1/ncat/Makefile.in     Tue Feb 16 09:33:56 2010
+++ nmap-5.30BETA1.Solaris/ncat/Makefile.in     Thu Apr  1 03:28:19 2010
@@ -126,10 +126,14 @@  .PHONY: uninstall all clean distclean
$(NBASEDIR)/libnbase.a: $(NBASEDIR)/Makefile
+
+$(NBASEDIR)/Makefile:
      @echo Compiling libnbase;         cd $(NBASEDIR) && $(MAKE)
$(NSOCKDIR)/libnsock.a: $(NSOCKDIR)/Makefile
+
+$(NSOCKDIR)/Makefile:
      @echo Compiling libnsock;         cd $(NSOCKDIR) && $(MAKE)

diff -r -u nmap-5.30BETA1/nsock/src/Makefile.in nmap-5.30BETA1.Solaris/nsock/src/Makefile.in
--- nmap-5.30BETA1/nsock/src/Makefile.in        Fri Aug  7 10:53:50 2009
+++ nmap-5.30BETA1.Solaris/nsock/src/Makefile.in Thu Apr 1 03:29:56 2010
@@ -44,6 +44,8 @@
      $(RANLIB) $@

$(NBASEDIR)/libnbase.a: $(NBASEDIR)/Makefile
+
+$(NBASEDIR)/Makefile:
      cd $(NBASEDIR) && $(MAKE)

clean:



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


Current thread: