1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-09 22:21:29 +00:00

Fix a bug in Windows interface matching. The code was supposed to check if a

MAC address matched the expected address, and if so, take that as a preliminary
match before checking the description string for a stronger match. But if
retrieving the the MAC address failed completely, it was still being accepted
as a preliminary match, and would prevent later matches with only the MAC
address from being accepted.
This commit is contained in:
david
2011-02-10 05:52:22 +00:00
parent e94bdc7f5f
commit 7f7c78ad96

View File

@@ -441,12 +441,12 @@ intf_get_pcap_devname(const char *intf_name, char *pcapdev, int pcapdevlen)
/* Check the MAC address if available. */
data->Oid = OID_802_3_CURRENT_ADDRESS;
data->Length = sizeof(buf) - sizeof(*data);
if (PacketRequest(lpa, FALSE, data) == TRUE) {
if (data->Length != ifrow.dwPhysAddrLen)
goto close_adapter;
if (memcmp(ifrow.bPhysAddr, data->Data, data->Length) != 0)
goto close_adapter;
}
if (!PacketRequest(lpa, FALSE, data))
goto close_adapter;
if (data->Length != ifrow.dwPhysAddrLen)
goto close_adapter;
if (memcmp(ifrow.bPhysAddr, data->Data, data->Length) != 0)
goto close_adapter;
/* A hardware address match is good enough, but we will prefer
an additional match with the description if available. */