Skip to content

Commit 13110e3

Browse files
committed
LocalIP (GNU): adds MAC addr detection support
1 parent 0b2c044 commit 13110e3

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/detection/localip/localip_linux.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1008,14 +1008,16 @@ const char* ffDetectLocalIps(const FFLocalIpOptions* options, FFlist* results)
10081008
#endif
10091009
}
10101010

1011-
#ifdef __sun
1011+
#if __sun || __GNU__
10121012
if ((options->showType & FF_LOCALIP_TYPE_MAC_BIT) && ioctl(sockfd, SIOCGIFHWADDR, &ifr) == 0)
10131013
{
10141014
const uint8_t* ptr = (uint8_t*) ifr.ifr_addr.sa_data; // NOT ifr_enaddr
10151015
ffStrbufSetF(&iface->mac, "%02x:%02x:%02x:%02x:%02x:%02x",
10161016
ptr[0], ptr[1], ptr[2], ptr[3], ptr[4], ptr[5]);
1017-
FF_DEBUG("Added MAC address %s for interface %s (Solaris)", iface->mac.chars, iface->name.chars);
1017+
FF_DEBUG("Added MAC address %s for interface %s (Solaris/GNU)", iface->mac.chars, iface->name.chars);
10181018
}
1019+
#endif
1020+
#if __sun
10191021
if (options->showType & FF_LOCALIP_TYPE_SPEED_BIT)
10201022
{
10211023
__attribute__((__cleanup__(kstatFreeWrap))) kstat_ctl_t* kc = kstat_open();

0 commit comments

Comments
 (0)