Merge pull request #362 from shbatm/mac_fix

Use MAC address of first connected interface
pull/373/head
sfeakes 2024-11-17 13:53:02 -06:00 committed by GitHub
commit 0b1b7f055f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
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;}