Skip to content

Commit 8687505

Browse files
committed
LocalIP (Linux): skips interfaces without IPs unless MAC display is enabled
1 parent 34c34d2 commit 8687505

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/detection/localip/localip_linux.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,13 @@ const char* ffDetectLocalIps(const FFLocalIpOptions* options, FFlist* results)
414414
FF_DEBUG("Processing adapter %s (IPv4 entries: %u, IPv6 entries: %u)",
415415
adapter->mac->ifa_name, adapter->ipv4.length, adapter->ipv6.length);
416416

417+
if (adapter->ipv4.length == 0 && adapter->ipv6.length == 0 &&
418+
!(options->showType & FF_LOCALIP_TYPE_MAC_BIT) )
419+
{
420+
FF_DEBUG("Skipping interface %s (no IP addresses)", adapter->mac->ifa_name);
421+
continue;
422+
}
423+
417424
FFLocalIpResult* item = FF_LIST_ADD(FFLocalIpResult, *results);
418425
ffStrbufInitS(&item->name, adapter->mac->ifa_name);
419426
ffStrbufInit(&item->ipv4);

0 commit comments

Comments
 (0)