mirror of
https://github.com/nmap/nmap.git
synced 2025-12-11 10:19:03 +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:
@@ -441,12 +441,12 @@ intf_get_pcap_devname(const char *intf_name, char *pcapdev, int pcapdevlen)
|
|||||||
/* Check the MAC address if available. */
|
/* Check the MAC address if available. */
|
||||||
data->Oid = OID_802_3_CURRENT_ADDRESS;
|
data->Oid = OID_802_3_CURRENT_ADDRESS;
|
||||||
data->Length = sizeof(buf) - sizeof(*data);
|
data->Length = sizeof(buf) - sizeof(*data);
|
||||||
if (PacketRequest(lpa, FALSE, data) == TRUE) {
|
if (!PacketRequest(lpa, FALSE, data))
|
||||||
if (data->Length != ifrow.dwPhysAddrLen)
|
goto close_adapter;
|
||||||
goto close_adapter;
|
if (data->Length != ifrow.dwPhysAddrLen)
|
||||||
if (memcmp(ifrow.bPhysAddr, data->Data, data->Length) != 0)
|
goto close_adapter;
|
||||||
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
|
/* A hardware address match is good enough, but we will prefer
|
||||||
an additional match with the description if available. */
|
an additional match with the description if available. */
|
||||||
|
|||||||
Reference in New Issue
Block a user