network/route: also remove route on cancelling request

Otherwise, the route may arrive after we call
link_drop_foreign_address() or so on reconfiguring interface.

This is the one for routes of 4303e9806b.
This commit is contained in:
Yu Watanabe
2024-01-25 16:43:44 +09:00
parent d529b12a01
commit 97979ece0e
+7
View 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:
;
}