Use MAC address of first connected interface

pull/362/head
shbatm 2024-11-17 13:46:35 -06:00
parent 3399664ee5
commit 465534c9af
1 changed files with 5 additions and 0 deletions

View File

@ -235,6 +235,11 @@ bool mac(char *buf, int len, bool useDelimiter)
continue;
}
if ((ioctl(fd, SIOCGIFFLAGS, &s) < 0) || !(s.ifr_flags & IFF_RUNNING))
{
continue;
}
int i;
int step=2;
if (useDelimiter) {step=3;}