From 9bd68008df9e761cbf8014362ed07c9188e37878 Mon Sep 17 00:00:00 2001 From: dmiller Date: Thu, 28 Aug 2025 19:28:41 +0000 Subject: [PATCH] Ensure we don't use --send-eth for localhost --- scan_engine.cc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scan_engine.cc b/scan_engine.cc index 3f96e51d7..2087202cb 100644 --- a/scan_engine.cc +++ b/scan_engine.cc @@ -956,6 +956,13 @@ void UltraScanInfo::Init(std::vector &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, ðsd)) { fatal("Couldn't open a raw socket or eth handle."); }