]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
network: fix error aggregation in wwan_check_and_set_configuration()
authornoxiouz <atiurin@proton.me>
Mon, 2 Mar 2026 22:42:16 +0000 (22:42 +0000)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 2 Mar 2026 23:59:48 +0000 (08:59 +0900)
When removing marked routes, the condition `if (ret)` incorrectly
overwrites any previously accumulated error in `ret` with the latest
return value `r`, even if `r >= 0` (success). This means an earlier
real error can be silently cleared by a subsequent successful
route_remove() call.

The parallel address_remove() block just above uses the correct
`if (r < 0)` pattern. Apply the same fix to the route_remove() block.

src/network/networkd-wwan.c

index 325d2b028188b14a7a696d2e3278c4fa51c6af6d..2b10eb3e4ee960118d928000c15ebab30796c8cd 100644 (file)
@@ -529,7 +529,7 @@ static int link_apply_bearer_impl(Link *link, Bearer *b) {
                         continue;
 
                 r = route_remove(route, link->manager);
-                if (ret)
+                if (r < 0)
                         ret = r;
         }