<listitem><para>Specifies the name or the index of the uplink interface, or one of the special
values <literal>:none</literal> and <literal>:auto</literal>. When emitting DNS servers or
search domains is enabled but no servers are specified, the servers configured in the uplink
- interface will be emitted. When <literal>:auto</literal>, the link which has a default gateway
- with the highest priority will be automatically selected. When <literal>:none</literal>, no
- uplink interface will be selected. Defaults to <literal>:auto</literal>.</para></listitem>
+ interface will be emitted. When <literal>:auto</literal>, the value specified to the same
+ setting in the [DHCPv6PrefixDelegation] section will be used if
+ <varname>DHCPv6PrefixDelegation=</varname> is enabled, otherwise the link which has a default
+ gateway with the highest priority will be automatically selected. When <literal>:none</literal>,
+ no uplink interface will be selected. Defaults to <literal>:auto</literal>.</para></listitem>
</varlistentry>
<varlistentry>
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);
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);
}
static int radv_find_uplink(Link *link, Link **ret) {
+ int r;
+
assert(link);
if (link->network->router_uplink_name)
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;
}