]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
network/route: also remove route on cancelling request
authorYu Watanabe <watanabe.yu+github@gmail.com>
Sat, 6 Jan 2024 21:11:09 +0000 (06:11 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 25 Jan 2024 07:43:44 +0000 (16:43 +0900)
Otherwise, the route may arrive after we call
link_drop_foreign_address() or so on reconfiguring interface.

This is the one for routes of 4303e9806befc0c5b8067e45225e5d952f427b3a.

src/network/networkd-link.c

index a79ab0d43c12bac6c595119071851aec2c89f011..194d31eafe89dea0e5540f0444d8bd2323a9f9fe 100644 (file)
@@ -997,6 +997,13 @@ static int link_drop_requests(Link *link) {
                                         RET_GATHER(ret, nexthop_remove(nexthop, link->manager));
                                 break;
                         }
+                        case REQUEST_TYPE_ROUTE: {
+                                Route *route = ASSERT_PTR(req->userdata);
+
+                                if (route_get(link->manager, route, NULL) < 0)
+                                        RET_GATHER(ret, route_remove(route, link->manager));
+                                break;
+                        }
                         default:
                                 ;
                         }