network: dhcp6: make UplinkInterface=:self take effect only when DHCPv6PrefixDelegation= is enabled

This commit is contained in:
Yu Watanabe 2021-12-01 14:48:51 +09:00
parent f6032ff3e0
commit 926fc8ee63
2 changed files with 9 additions and 5 deletions

View file

@ -2106,11 +2106,12 @@ Table=1234</programlisting></para>
<listitem>
<para>Allows DHCPv6 client to start without router advertisements's managed or other
address configuration flag. Takes one of <literal>no</literal>, <literal>solicit</literal>
or <literal>information-request</literal>. When this is not specified and
<varname>UplinkInterface=:self</varname> is specified, then <literal>solicit</literal> is
implied. Otherwise, defaults to <literal>no</literal>, and the DHCPv6 client will be
started when an RA is received. See also <varname>DHCPv6Client=</varname> setting in the
[IPv6AcceptRA] section.</para>
or <literal>information-request</literal>. If this is not specified,
<literal>solicit</literal> is used when <varname>DHCPv6PrefixDelegation=</varname> is
enabled and <varname>UplinkInterface=:self</varname> is specified in the
[DHCPv6PrefixDelegation] section. Otherwise, defaults to <literal>no</literal>, and the
DHCPv6 client will be started when an RA is received. See also
<varname>DHCPv6Client=</varname> setting in the [IPv6AcceptRA] section.</para>
</listitem>
</varlistentry>
</variablelist>

View file

@ -70,6 +70,9 @@ static DHCP6ClientStartMode link_get_dhcp6_client_start_mode(Link *link) {
if (link->network->dhcp6_client_start_mode >= 0)
return link->network->dhcp6_client_start_mode;
if (!link_dhcp6_pd_is_enabled(link))
return DHCP6_CLIENT_START_MODE_NO;
if (dhcp6_pd_resolve_uplink(link, &uplink) < 0)
return DHCP6_CLIENT_START_MODE_NO;