From 465534c9af7ddcc764e6c5334d8d6ab08bfc824d Mon Sep 17 00:00:00 2001 From: shbatm Date: Sun, 17 Nov 2024 13:46:35 -0600 Subject: [PATCH] Use MAC address of first connected interface --- source/config.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/source/config.c b/source/config.c index 6b08d69..7b54989 100644 --- a/source/config.c +++ b/source/config.c @@ -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;}