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

Fix various fatal errors around --send-eth

This commit is contained in:
dmiller
2025-09-03 17:04:47 +00:00
parent 5bb82a2ad0
commit 99e396b4a0
8 changed files with 27 additions and 19 deletions

View File

@@ -956,14 +956,8 @@ void UltraScanInfo::Init(std::vector<Target *> &Targets, const struct scan_lists
assert(!(sendpref & PACKET_SEND_IP_STRONG));
sendpref = PACKET_SEND_ETH;
}
#ifndef WIN32
/* Windows does loopback via Npcap (eth),
* but we want to avoid that for everyone else. */
if (Targets[0]->ifType() == devt_loopback) {
sendpref = PACKET_SEND_IP;
}
#endif
if (!raw_socket_or_eth(sendpref, Targets[0]->deviceName(), &rawsd, &ethsd)) {
if (!raw_socket_or_eth(sendpref, Targets[0]->deviceName(), Targets[0]->ifType(),
&rawsd, &ethsd)) {
fatal("Couldn't open a raw socket or eth handle.");
}
/* Raw scan types also need to know the source IP. */