Skip to content

Commit

Permalink
Merge pull request #362 from shbatm/mac_fix
Browse files Browse the repository at this point in the history
Use MAC address of first connected interface
  • Loading branch information
sfeakes authored Nov 17, 2024
2 parents 3399664 + 465534c commit 0b1b7f0
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions source/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;}
Expand Down

0 comments on commit 0b1b7f0

Please sign in to comment.