From: Mike Brady <4265913+mikebrady@users.noreply.github.com> Date: Mon, 5 Jan 2026 21:19:11 +0000 (+0000) Subject: Add Carl Johnson's suggestion for omitting dummy internet interfaces. X-Git-Tag: 5.0-post-dev~14 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=45063d101ff153cdfb4e529dcaabd6403eb4c315;p=thirdparty%2Fshairport-sync.git Add Carl Johnson's suggestion for omitting dummy internet interfaces. --- diff --git a/common.c b/common.c index 84de277a..e552af4c 100644 --- a/common.c +++ b/common.c @@ -51,6 +51,7 @@ #include #include +#include #include #ifdef COMPILE_FOR_LINUX @@ -2329,7 +2330,12 @@ int get_device_id(uint8_t *id, int int_length) { #ifdef AF_PACKET if ((ifa->ifa_addr) && (ifa->ifa_addr->sa_family == AF_PACKET)) { struct sockaddr_ll *s = (struct sockaddr_ll *)ifa->ifa_addr; - if ((strcmp(ifa->ifa_name, "lo") != 0)) { + if ( + ((ifa->ifa_flags & IFF_UP) != 0) && + ((ifa->ifa_flags & IFF_RUNNING) != 0) && + ((ifa->ifa_flags & IFF_LOOPBACK) == 0) && + (ifa->ifa_addr != 0) + ) { found = 1; response = 0; for (i = 0; ((i < s->sll_halen) && (i < int_length)); i++) {