diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2022-02-28 10:55:51 +0900 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2022-03-11 14:20:31 +0900 |
commit | 09d09207dece533ced25c91024ce7a1c0ed660d8 (patch) | |
tree | 386d5fc738c98f696d928aa399d4ea98fdfbae7c /src/network/networkd-ipv6-proxy-ndp.c | |
parent | 4c8b81caa518df34d4e69f6660fc4fbdf0b42ce4 (diff) | |
download | systemd-09d09207dece533ced25c91024ce7a1c0ed660d8.tar.gz |
network: re-design request queue
This makes Request object takes hash, compare, free, and process functions.
With this change, the logic in networkd-queue.c can be mostly
independent of the type of the request or the object (e.g. Address) assigned
to the request, and it becomes simpler.
Diffstat (limited to 'src/network/networkd-ipv6-proxy-ndp.c')
-rw-r--r-- | src/network/networkd-ipv6-proxy-ndp.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/network/networkd-ipv6-proxy-ndp.c b/src/network/networkd-ipv6-proxy-ndp.c index b245a9eba2..8166851ed3 100644 --- a/src/network/networkd-ipv6-proxy-ndp.c +++ b/src/network/networkd-ipv6-proxy-ndp.c @@ -78,7 +78,7 @@ static int ipv6_proxy_ndp_address_configure(const struct in6_addr *address, Link return request_call_netlink_async(link->manager->rtnl, m, req); } -int ipv6_proxy_ndp_address_process_request(Request *req, Link *link, struct in6_addr *address) { +static int ipv6_proxy_ndp_address_process_request(Request *req, Link *link, struct in6_addr *address) { int r; assert(req); @@ -105,10 +105,14 @@ int link_request_static_ipv6_proxy_ndp_addresses(Link *link) { link->static_ipv6_proxy_ndp_configured = false; SET_FOREACH(address, link->network->ipv6_proxy_ndp_addresses) { - r = link_queue_request(link, REQUEST_TYPE_IPV6_PROXY_NDP, address, false, - &link->static_ipv6_proxy_ndp_messages, - (request_netlink_handler_t) ipv6_proxy_ndp_address_configure_handler, - NULL); + r = link_queue_request_safe(link, REQUEST_TYPE_IPV6_PROXY_NDP, + address, NULL, + in6_addr_hash_func, + in6_addr_compare_func, + ipv6_proxy_ndp_address_process_request, + &link->static_ipv6_proxy_ndp_messages, + ipv6_proxy_ndp_address_configure_handler, + NULL); if (r < 0) return log_link_warning_errno(link, r, "Failed to request IPv6 proxy NDP address: %m"); } |