diff --git a/CHANGELOG b/CHANGELOG index e895f7429..93ab11628 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -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] diff --git a/libdnet-stripped/NMAP_MODIFICATIONS b/libdnet-stripped/NMAP_MODIFICATIONS index 8e763a0ba..6e52a4f21 100644 --- a/libdnet-stripped/NMAP_MODIFICATIONS +++ b/libdnet-stripped/NMAP_MODIFICATIONS @@ -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 *)𝔦 /* XXX */ diff --git a/libdnet-stripped/src/intf.c b/libdnet-stripped/src/intf.c index b71fb829a..315e7b0bb 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 *)𝔦 /* XXX */