6827835 nmap: unable to open interface (b109)
authorMike Sullivan <Mike.Sullivan@Oracle.COM>
Thu, 03 Nov 2011 10:41:43 -0700
changeset 565 39e748a05913
parent 564 864060807923
child 566 df90f8949db7
6827835 nmap: unable to open interface (b109)
components/nmap/patches/94.eth-dlpi.c.patch
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/nmap/patches/94.eth-dlpi.c.patch	Thu Nov 03 10:41:43 2011 -0700
@@ -0,0 +1,21 @@
+--- nmap-5.21/libdnet-stripped/src/eth-dlpi.c	2008-09-18 23:12:25.000000000 -0700
++++ nmap-5.21/libdnet-stripped/src/eth-dlpi.c	2011-07-08 02:15:01.517564899 -0700
[email protected]@ -120,7 +120,7 @@
+ {
+ 	union DL_primitives *dlp;
+ 	uint32_t buf[8192];
+-	char *p, dev[16];
++	char *p, dev[64];
+ 	eth_t *e;
+ 	int ppa;
+ 
[email protected]@ -145,6 +145,9 @@
+ 	ppa = atoi(p);
+ 	*p = '\0';
+ 
++#if defined(sun) || defined(__sun) || defined(__sun)
++	snprintf(dev, sizeof(dev), "/dev/net/%s", device);
++#endif
+ 	if ((e->fd = open(dev, O_RDWR)) < 0) {
+ 		snprintf(dev, sizeof(dev), "/dev/%s", device);
+ 		if ((e->fd = open(dev, O_RDWR)) < 0)