diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2020-07-07 01:38:37 +0200 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2020-07-07 19:48:26 +0200 |
commit | a211ff4b842fd4638602de347d640bf7df6ae248 (patch) | |
tree | 5713aea7fe3931e27ccae0939632675ae3ec3fce /src | |
parent | networkd: use capitalized "IP" and "TOS" in messages (diff) | |
download | systemd-a211ff4b842fd4638602de347d640bf7df6ae248.tar.xz systemd-a211ff4b842fd4638602de347d640bf7df6ae248.zip |
network: introduce own address handler for dhcp6 delegated prefix
Fixes #16365.
Diffstat (limited to 'src')
-rw-r--r-- | src/network/networkd-dhcp6.c | 29 |
1 files changed, 26 insertions, 3 deletions
diff --git a/src/network/networkd-dhcp6.c b/src/network/networkd-dhcp6.c index 6637e81c66..73b49a5ec0 100644 --- a/src/network/networkd-dhcp6.c +++ b/src/network/networkd-dhcp6.c @@ -998,6 +998,31 @@ static int dhcp6_prefix_remove_all(Manager *m, Link *link) { return 0; } +static int dhcp6_assign_delegeted_prefix_address_handler(sd_netlink *rtnl, sd_netlink_message *m, Link *link) { + int r; + + assert(link); + + if (IN_SET(link->state, LINK_STATE_FAILED, LINK_STATE_LINGER)) + return 1; + + r = sd_netlink_message_get_errno(m); + if (r < 0 && r != -EEXIST) { + log_link_message_warning_errno(link, m, r, "Could not set DHCPv6 delegated prefix address "); + link_enter_failed(link); + return 1; + } else if (r >= 0) + (void) manager_rtnl_process_address(rtnl, m, link->manager); + + r = link_request_set_routes(link); + if (r < 0) { + link_enter_failed(link); + return 1; + } + + return 1; +} + static int dhcp6_assign_delegated_prefix(Link *link, const struct in6_addr *prefix, uint8_t prefix_len, @@ -1035,11 +1060,9 @@ static int dhcp6_assign_delegated_prefix(Link *link, link_set_state(link, LINK_STATE_CONFIGURING); - r = address_configure(address, link, address_handler, true); + r = address_configure(address, link, dhcp6_assign_delegeted_prefix_address_handler, true); if (r < 0) return log_link_warning_errno(link, r, "Failed to set acquired DHCPv6 delegated prefix address: %m"); - if (r > 0) - link->address_messages++; return 0; } |