components/nmap/patches/91.tcpip.cc.patch
author Srinivasa Sarva <srinivasa.sarva@oracle.com>
Fri, 07 Sep 2012 12:05:40 -0700
branchs11-sru
changeset 2339 96ba33152279
parent 146 8e22ba234817
permissions -rw-r--r--
6997071 nmap chokes if allowed to pick interface

--- nmap-5.21/tcpip.cc.~1~	2010-01-14 19:55:23.000000000 -0800
+++ nmap-5.21/tcpip.cc	2012-07-12 16:11:16.916489138 -0700
@@ -2296,6 +2296,11 @@
     offset = 16;
     break;
 #endif
+#ifdef DLT_IPNET
+  case DLT_IPNET:
+    offset = 24;
+    break;
+#endif
   default:
     p = (char *) pcap_next(pd, &head);
     if (head.caplen == 0) {
@@ -3124,7 +3129,7 @@
       devs[count].device_type = devt_ethernet;
 
       /* If the device type is ethernet, get the MAC address. */
-#ifdef SIOCGIFHWADDR
+#if defined(SIOCGIFHWADDR) && (!defined(sun) && !defined(__sun) && !defined(__sun__))
       memcpy(&tmpifr.ifr_addr, sin, MIN(sizeof(tmpifr.ifr_addr), sizeof(*sin)));
       rc = ioctl(sd, SIOCGIFHWADDR, &tmpifr);
       if (rc < 0 && errno != EADDRNOTAVAIL)