diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2022-02-26 15:56:39 +0900 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2022-03-11 14:16:41 +0900 |
commit | ff51134c93a748524b75b4fd492f9c03cb02f65c (patch) | |
tree | aa4dd86f335acceeecb3de90f3ae9fb2f466892d /src/network/networkd-nexthop.c | |
parent | 54ff39f7aecbefeb6f480ea61fbacc4ee554dacc (diff) | |
download | systemd-ff51134c93a748524b75b4fd492f9c03cb02f65c.tar.gz |
network: make request_process_address() and friends take Link and corresponding object
This also renames e.g. request_process_address() -> address_process_request().
Also, this drops type checks such as `assert(req->type == REQUEST_TYPE_ADDRESS)`,
as in the later commits, the function of processing request, e.g.
`address_process_request()`, will be assigned to the Request object when
it is created. And the request type will be used to distinguish and to
avoid deduplicating requests which do not have any assigned objects,
like REQUEST_TYPE_DHCP4_CLIENT. Hence, the type checks in process functions
are mostly not necessary and redundant.
This is mostly cleanups and preparation for later commits, and should
not change any behavior.
Diffstat (limited to 'src/network/networkd-nexthop.c')
-rw-r--r-- | src/network/networkd-nexthop.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/network/networkd-nexthop.c b/src/network/networkd-nexthop.c index ed9d621587..143ecce6c4 100644 --- a/src/network/networkd-nexthop.c +++ b/src/network/networkd-nexthop.c @@ -565,16 +565,12 @@ static bool nexthop_is_ready_to_configure(Link *link, const NextHop *nexthop) { return gateway_is_ready(link, FLAGS_SET(nexthop->flags, RTNH_F_ONLINK), nexthop->family, &nexthop->gw); } -int request_process_nexthop(Request *req) { - NextHop *nexthop; - Link *link; +int nexthop_process_request(Request *req, Link *link, NextHop *nexthop) { int r; assert(req); - assert(req->type == REQUEST_TYPE_NEXTHOP); - - nexthop = ASSERT_PTR(req->nexthop); - link = ASSERT_PTR(req->link); + assert(link); + assert(nexthop); if (!nexthop_is_ready_to_configure(link, nexthop)) return 0; |