1
0
mirror of https://github.com/nmap/nmap.git synced 2026-01-04 05:39:01 +00:00

Fix 'INTERFACES: NONE FOUND' for real. See also: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=821913

This commit is contained in:
dmiller
2016-04-25 05:20:56 +00:00
parent fbdd7f53d9
commit 312cff5ac5
3 changed files with 32 additions and 2 deletions

View File

@@ -1,5 +1,10 @@
# Nmap Changelog ($Id$); -*-text-*-
o Changed libdnet-stripped to avoid bailing completely when an interface is
encountered with an unsupported hardware address type. Caused "INTERFACES:
NONE FOUND!" bugs in Nmap whenever Linux kernel added new hardware address
types. [Daniel Miller]
o [NSE][GH362] Added support for LDAP over udp to ldap-rootdse.nse.
Also added version detection and information extraction to match the
new LDAP LDAPSearchReq and LDAPSearchReqUDP probes. [Tom Sellers]

View File

@@ -2262,3 +2262,25 @@ index 3c09f9c..77225b6 100644
/* Loop through all the pcap devices until we find a match. */
selected = NULL;
o Avoid bailing completely when an interface is encountered with an unsupported
hardware address type. Caused "INTERFACES: NONE FOUND!" bugs in Nmap.
diff --git a/libdnet-stripped/src/intf.c b/libdnet-stripped/src/intf.c
index b71fb82..315e7b0 100644
--- a/libdnet-stripped/src/intf.c
+++ b/libdnet-stripped/src/intf.c
@@ -561,8 +561,11 @@ _intf_get_noalias(intf_t *intf, struct intf_entry *entry)
#elif defined(SIOCGIFHWADDR)
if (ioctl(intf->fd, SIOCGIFHWADDR, &ifr) < 0)
return (-1);
- if (addr_ston(&ifr.ifr_addr, &entry->intf_link_addr) < 0)
- return (-1);
+ if (addr_ston(&ifr.ifr_addr, &entry->intf_link_addr) < 0) {
+ /* Likely we got an unsupported address type. Just use NONE for now. */
+ entry->intf_link_addr.addr_type = ADDR_TYPE_NONE;
+ entry->intf_link_addr.addr_bits = 0;
+ }
#elif defined(SIOCRPHYSADDR)
/* Tru64 */
struct ifdevea *ifd = (struct ifdevea *)&ifr; /* XXX */

View File

@@ -561,8 +561,11 @@ _intf_get_noalias(intf_t *intf, struct intf_entry *entry)
#elif defined(SIOCGIFHWADDR)
if (ioctl(intf->fd, SIOCGIFHWADDR, &ifr) < 0)
return (-1);
if (addr_ston(&ifr.ifr_addr, &entry->intf_link_addr) < 0)
return (-1);
if (addr_ston(&ifr.ifr_addr, &entry->intf_link_addr) < 0) {
/* Likely we got an unsupported address type. Just use NONE for now. */
entry->intf_link_addr.addr_type = ADDR_TYPE_NONE;
entry->intf_link_addr.addr_bits = 0;
}
#elif defined(SIOCRPHYSADDR)
/* Tru64 */
struct ifdevea *ifd = (struct ifdevea *)&ifr; /* XXX */