Skip to content

Commit

Permalink
Use MAC address of first connected interface
Browse files Browse the repository at this point in the history
  • Loading branch information
shbatm committed Nov 17, 2024
1 parent 3399664 commit 465534c
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 465534c

Please sign in to comment.