From a88bda3d7898beeebe39aa884d2234275087bade Mon Sep 17 00:00:00 2001 From: david Date: Mon, 20 Jul 2009 18:59:58 +0000 Subject: [PATCH] Make it a warning, not a fatal error, when we can't get the hardware address for an interface, and skip the interface. The warning looks like Warning: Unable to get hardware address for interface %s -- skipping it. This happens when a FireWire interface (fw*) has an address configured on Mac OS X. Previously Nmap would die in getinterfaces so it wasn't even possible to scan over the other interfaces. --- CHANGELOG | 6 ++++++ tcpip.cc | 7 ++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index d60e85cdc..90830d204 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,11 @@ # Nmap Changelog ($Id$); -*-text-*- +o Nmap now prints a warning instead of a fatal error when the hardware + address of an interface can't be found. This is the case for + FireWire interfaces, which have a hardware address format not + supported by libdnet. Thanks to Julian Berdych for the bug report. + [David] + o Added the pjl-ready-message.nse script from Aaron Leininger. This script allows viewing and setting the message displayed by printers that support the Printer Job Language. diff --git a/tcpip.cc b/tcpip.cc index d64f78664..aba8551d8 100644 --- a/tcpip.cc +++ b/tcpip.cc @@ -3034,9 +3034,10 @@ static struct interface_info *getinterfaces_siocgifconf(int *howmany) { error("Warning: Unable to open interface %s -- skipping it.", devs[count].devname); continue; } - if (eth_get(ethsd, ðaddr) != 0) - fatal("%s: Failed to obtain MAC address for ethernet interface (%s)", - __func__, devs[count].devname); + if (eth_get(ethsd, ðaddr) != 0) { + error("Warning: Unable to get hardware address for interface %s -- skipping it.", devs[count].devname); + continue; + } memcpy(devs[count].mac, ethaddr.data, 6); #endif /*SIOCGIFHWADDR*/ } else if (ifflags & IFF_POINTOPOINT) {