SDL_net: RefreshInterfaces: getifaddrs path should ignore interfaces that aren't up.

From 5acaedf2e10e88b5b3f37f84debc18005d9f6ff9 Mon Sep 17 00:00:00 2001
From: "Ryan C. Gordon" <[EMAIL REDACTED]>
Date: Mon, 25 May 2026 01:36:31 -0400
Subject: [PATCH] RefreshInterfaces: getifaddrs path should ignore interfaces
 that aren't up.

---
 src/SDL_net.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/SDL_net.c b/src/SDL_net.c
index 38a4f83..0363451 100644
--- a/src/SDL_net.c
+++ b/src/SDL_net.c
@@ -713,7 +713,7 @@ static void RefreshInterfaces(void)  // LINUX/BSD VERSION
     NetworkInterface *new_interfaces = NULL;
     int new_num_interfaces = 0;
     for (struct ifaddrs *i = ifaddr; i != NULL; i = i->ifa_next) {
-        if (i->ifa_name && i->ifa_addr) {
+        if (i->ifa_name && i->ifa_addr && (i->ifa_flags & IFF_UP)) {
             new_num_interfaces++;
         }
     }
@@ -729,8 +729,8 @@ static void RefreshInterfaces(void)  // LINUX/BSD VERSION
 
     NetworkInterface *iface = &new_interfaces[0];
     for (struct ifaddrs *i = ifaddr; i != NULL; i = i->ifa_next) {
-        if (!i->ifa_name || !i->ifa_addr) {
-            continue;  // i guess.
+        if (!i->ifa_name || !i->ifa_addr || ((i->ifa_flags & IFF_UP) == 0)) {
+            continue;
         }
 
         // !!! FIXME: getifaddrs doesn't return the sockaddr length, so we have to go with known protocols.  :/