summaryrefslogtreecommitdiff
path: root/src/network/networkd-queue.h
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.h
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.h')
-rw-r--r--src/network/networkd-queue.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/network/networkd-queue.h b/src/network/networkd-queue.h
index 369e7db3a2..f8664d087c 100644
--- a/src/network/networkd-queue.h
+++ b/src/network/networkd-queue.h
@@ -5,7 +5,10 @@
#include "networkd-link.h"
+typedef struct Address Address;
typedef struct Neighbor Neighbor;
+typedef struct NextHop NextHop;
+typedef struct Route Route;
typedef struct RoutingPolicyRule RoutingPolicyRule;
typedef struct Request Request;
@@ -14,7 +17,10 @@ typedef int (*request_after_configure_handler_t)(Request*, void*);
typedef void (*request_on_free_handler_t)(Request*);
typedef enum RequestType {
+ REQUEST_TYPE_ADDRESS,
REQUEST_TYPE_NEIGHBOR,
+ REQUEST_TYPE_NEXTHOP,
+ REQUEST_TYPE_ROUTE,
REQUEST_TYPE_ROUTING_POLICY_RULE,
_REQUEST_TYPE_MAX,
_REQUEST_TYPE_INVALID = -EINVAL,
@@ -25,7 +31,10 @@ typedef struct Request {
RequestType type;
bool consume_object;
union {
+ Address *address;
Neighbor *neighbor;
+ NextHop *nexthop;
+ Route *route;
RoutingPolicyRule *rule;
void *object;
};