]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
networkd-wwan: drop unreachable unknown-bearer fallback path
authornoxiouz <atiurin@proton.me>
Tue, 7 Apr 2026 13:47:33 +0000 (14:47 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 8 Apr 2026 15:28:19 +0000 (17:28 +0200)
bearer_get_by_path() only succeeds when both modem and bearer are found.
On failure, trying bearer_new_and_initialize(modem, path) was
unreachable and relied on a modem value that is not returned on that
path.

Treat unknown bearers as no-op and rely on modem_map_bearers() for
association during initialization.

Co-developed-by: Codex (GPT-5) <noreply@openai.com>
src/network/networkd-wwan-bus.c

index 434063ee6c1d5482b2b7c983c00534688a889a1d..19fcf081ae18878d72898a782c176e001fef1f6c 100644 (file)
@@ -807,15 +807,10 @@ static int bearer_properties_changed_handler(
         if (!path)
                 return 0;
 
-        if (bearer_get_by_path(manager, path, &modem, &b) < 0) {
-                /*
-                 * Have new bearer: check if we have the corresponding modem
-                 * for it which we might not during initialization.
-                 */
-                if (modem)
-                        (void) bearer_new_and_initialize(modem, path);
+        if (bearer_get_by_path(manager, path, &modem, &b) < 0)
+                /* Unknown bearer, nothing to do. Modem-bearer association is handled
+                 * by modem_map_bearers() during modem property initialization. */
                 return 0;
-        }
 
         if (b->slot_getall) {
                 /* Not initialized yet. Re-initialize it. */