From e7a6b841071daf07fb54ff3a77de7e968c645247 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Thu, 24 Jul 2025 19:31:31 +0800 Subject: [PATCH] LocalIP (Windows): ignore stopped interfaces --- src/detection/localip/localip_windows.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/detection/localip/localip_windows.c b/src/detection/localip/localip_windows.c index 7d5091699..8f10e76b4 100644 --- a/src/detection/localip/localip_windows.c +++ b/src/detection/localip/localip_windows.c @@ -95,6 +95,9 @@ const char* ffDetectLocalIps(const FFLocalIpOptions* options, FFlist* results) // Iterate through all of the adapters for (IP_ADAPTER_ADDRESSES* adapter = adapter_addresses; adapter; adapter = adapter->Next) { + if (adapter->OperStatus != IfOperStatusUp) + continue; + bool isDefaultRoute = adapter->IfIndex == defaultRouteIfIndex; if ((options->showType & FF_LOCALIP_TYPE_DEFAULT_ROUTE_ONLY_BIT) && !isDefaultRoute) continue;