From 10c4479b2df0d4eff513288a48da774edb9f7e73 Mon Sep 17 00:00:00 2001 From: dmiller Date: Tue, 5 Jul 2022 16:20:17 +0000 Subject: [PATCH] Fix #2416: listing interfaces on IPv6-only Linux. --- CHANGELOG | 3 +++ libdnet-stripped/src/intf.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index dbee50269..dc31b8283 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,8 @@ #Nmap Changelog ($Id$); -*-text-*- +o [GH#2416] Fix a bug that prevented Nmap from discovering interfaces on Linux + when no IPv4 addresses were configured. [Daniel Miller, nnposter] + o [NSE][GH#2463] NSE "exception handling" with nmap.new_try() will no longer result in a stack traceback in debug output nor a "ERROR: script execution failed" message in script output, since the intended behavior has always been diff --git a/libdnet-stripped/src/intf.c b/libdnet-stripped/src/intf.c index 6180d8526..d4faaeb4a 100644 --- a/libdnet-stripped/src/intf.c +++ b/libdnet-stripped/src/intf.c @@ -693,7 +693,7 @@ _intf_get_aliases(intf_t *intf, struct intf_entry *entry) struct addr *ap, *lap; char *p; - if (intf->ifc.ifc_len < (int)sizeof(*ifr)) { + if (intf->ifc.ifc_len < (int)sizeof(*ifr) && intf->ifc.ifc_len != 0) { errno = EINVAL; return (-1); }