diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2021-12-01 14:37:26 +0900 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2021-12-01 20:35:03 +0900 |
commit | f6032ff3e0970c93c97387e10c56a4be2a978948 (patch) | |
tree | 749235771bebf393cf322f9b6f04f722134b1b5d /src/network | |
parent | 312dac28695ebe7c316c9b2dec40bc7182f5e28e (diff) | |
download | systemd-f6032ff3e0970c93c97387e10c56a4be2a978948.tar.gz |
network: radv: use the uplink interface used in DHCPv6-PD
Diffstat (limited to 'src/network')
-rw-r--r-- | src/network/networkd-dhcp6.c | 2 | ||||
-rw-r--r-- | src/network/networkd-dhcp6.h | 1 | ||||
-rw-r--r-- | src/network/networkd-radv.c | 10 |
3 files changed, 10 insertions, 3 deletions
diff --git a/src/network/networkd-dhcp6.c b/src/network/networkd-dhcp6.c index 8d48aa9f88..da5a22a7b5 100644 --- a/src/network/networkd-dhcp6.c +++ b/src/network/networkd-dhcp6.c @@ -1452,7 +1452,7 @@ static bool dhcp6_pd_uplink_is_ready(Link *link) { return dhcp6_lease_has_pd_prefix(link->dhcp6_lease); } -static int dhcp6_pd_find_uplink(Link *link, Link **ret) { +int dhcp6_pd_find_uplink(Link *link, Link **ret) { Link *l; assert(link); diff --git a/src/network/networkd-dhcp6.h b/src/network/networkd-dhcp6.h index 4a522aebcf..9c5aff6af7 100644 --- a/src/network/networkd-dhcp6.h +++ b/src/network/networkd-dhcp6.h @@ -18,6 +18,7 @@ typedef struct Request Request; bool link_dhcp6_with_address_enabled(Link *link); bool link_dhcp6_pd_is_enabled(Link *link); +int dhcp6_pd_find_uplink(Link *link, Link **ret); int dhcp6_pd_remove(Link *link, bool only_marked); int dhcp6_update_mac(Link *link); int dhcp6_start(Link *link); diff --git a/src/network/networkd-radv.c b/src/network/networkd-radv.c index c98528aee9..a137270cfa 100644 --- a/src/network/networkd-radv.c +++ b/src/network/networkd-radv.c @@ -410,6 +410,8 @@ set_domains: } static int radv_find_uplink(Link *link, Link **ret) { + int r; + assert(link); if (link->network->router_uplink_name) @@ -419,8 +421,12 @@ static int radv_find_uplink(Link *link, Link **ret) { return link_get_by_index(link->manager, link->network->router_uplink_index, ret); if (link->network->router_uplink_index == UPLINK_INDEX_AUTO) { - /* It is not necessary to propagate error in automatic selection. */ - if (manager_find_uplink(link->manager, AF_INET6, link, ret) < 0) + if (link_dhcp6_pd_is_enabled(link)) + r = dhcp6_pd_find_uplink(link, ret); /* When DHCPv6PD is enabled, use its uplink. */ + else + r = manager_find_uplink(link->manager, AF_INET6, link, ret); + if (r < 0) + /* It is not necessary to propagate error in automatic selection. */ *ret = NULL; return 0; } |