summaryrefslogtreecommitdiff
path: root/src/network/networkd-queue.c
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2021-05-05 22:46:44 +0900
committerYu Watanabe <watanabe.yu+github@gmail.com>2021-05-12 11:26:06 +0900
commit76c5a0f27bb578b9069d779eed72f6c4f26976ac (patch)
treeeb47324d26ab5bbe8caedf692fc588739bcba8d6 /src/network/networkd-queue.c
parent40ca350ea1846d28fb3403217d47ed87eac57ad7 (diff)
downloadsystemd-76c5a0f27bb578b9069d779eed72f6c4f26976ac.tar.gz
network: use request queue to configure addresses, routes, and nexthops
Why is this necessary? Several examples below. - When a route sets prefsrc, then the address must be already assigned (see issue #19285), and also it must be ready if IPv6. - When a route or nexthop sets gateway, then the address must be reachable. - When a route sets nexthop ID, then the corresponding nexthop must be assigned. - When a route sets multipath routes on another interface, then the interface must exist and be ready to configure. - When configuring address, the same address must not be under removing (see issue #18108). Etc,. etc,... So, this makes all requests about addresses, routes, and nethops are once stored in the queue, and will be processed when they are ready to configure. Fixes #18108 and #19285.
Diffstat (limited to 'src/network/networkd-queue.c')
-rw-r--r--src/network/networkd-queue.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/network/networkd-queue.c b/src/network/networkd-queue.c
index c515e79716..3b9d17651e 100644
--- a/src/network/networkd-queue.c
+++ b/src/network/networkd-queue.c
@@ -10,9 +10,18 @@
static void request_free_object(RequestType type, void *object) {
switch(type) {
+ case REQUEST_TYPE_ADDRESS:
+ address_free(object);
+ break;
case REQUEST_TYPE_NEIGHBOR:
neighbor_free(object);
break;
+ case REQUEST_TYPE_NEXTHOP:
+ nexthop_free(object);
+ break;
+ case REQUEST_TYPE_ROUTE:
+ route_free(object);
+ break;
case REQUEST_TYPE_ROUTING_POLICY_RULE:
routing_policy_rule_free(object);
break;
@@ -107,9 +116,18 @@ int manager_process_requests(sd_event_source *s, void *userdata) {
ORDERED_SET_FOREACH(req, manager->request_queue) {
switch(req->type) {
+ case REQUEST_TYPE_ADDRESS:
+ r = request_process_address(req);
+ break;
case REQUEST_TYPE_NEIGHBOR:
r = request_process_neighbor(req);
break;
+ case REQUEST_TYPE_NEXTHOP:
+ r = request_process_nexthop(req);
+ break;
+ case REQUEST_TYPE_ROUTE:
+ r = request_process_route(req);
+ break;
case REQUEST_TYPE_ROUTING_POLICY_RULE:
r = request_process_routing_policy_rule(req);
break;