Merge pull request #11716 from ssahani/drop-autoconf-address

networkd: ipv6ra allow to ignore addresses
This commit is contained in:
Lennart Poettering 2019-02-15 12:17:46 +01:00 committed by GitHub
commit 84e4b0b893
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 32 additions and 4 deletions

View File

@ -1513,6 +1513,23 @@
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><varname>UseAutonomousPrefix=</varname></term>
<listitem>
<para>When true (the default), the autonomous prefix received in the Router Advertisement will be used and take
precedence over any statically configured ones.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><varname>UseOnLinkPrefix=</varname></term>
<listitem>
<para>When true (the default), the onlink prefix received in the Router Advertisement will be used and take
precedence over any statically configured ones.</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>

View File

@ -527,10 +527,13 @@ static void ndisc_router_process_options(Link *link, sd_ndisc_router *rt) {
return;
}
if (flags & ND_OPT_PI_FLAG_ONLINK)
(void) ndisc_router_process_onlink_prefix(link, rt);
if (flags & ND_OPT_PI_FLAG_AUTO)
(void) ndisc_router_process_autonomous_prefix(link, rt);
if (link->network->ipv6_accept_ra_use_onlink_prefix)
if (flags & ND_OPT_PI_FLAG_ONLINK)
(void) ndisc_router_process_onlink_prefix(link, rt);
if (link->network->ipv6_accept_ra_use_autonomous_prefix)
if (flags & ND_OPT_PI_FLAG_AUTO)
(void) ndisc_router_process_autonomous_prefix(link, rt);
break;
}

View File

@ -147,6 +147,8 @@ DHCP.IAID, config_parse_iaid,
DHCP.ListenPort, config_parse_uint16, 0, offsetof(Network, dhcp_client_port)
DHCP.RapidCommit, config_parse_bool, 0, offsetof(Network, rapid_commit)
DHCP.ForceDHCPv6PDOtherInformation, config_parse_bool, 0, offsetof(Network, dhcp6_force_pd_other_information)
IPv6AcceptRA.UseAutonomousPrefix, config_parse_bool, 0, offsetof(Network, ipv6_accept_ra_use_autonomous_prefix)
IPv6AcceptRA.UseOnLinkPrefix, config_parse_bool, 0, offsetof(Network, ipv6_accept_ra_use_onlink_prefix)
IPv6AcceptRA.UseDNS, config_parse_bool, 0, offsetof(Network, ipv6_accept_ra_use_dns)
IPv6AcceptRA.UseDomains, config_parse_dhcp_use_domains, 0, offsetof(Network, ipv6_accept_ra_use_domains)
IPv6AcceptRA.RouteTable, config_parse_uint32, 0, offsetof(Network, ipv6_accept_ra_route_table)

View File

@ -206,6 +206,8 @@ int network_load_one(Manager *manager, const char *filename) {
.multicast = -1,
.allmulticast = -1,
.ipv6_accept_ra_use_dns = true,
.ipv6_accept_ra_use_autonomous_prefix = true,
.ipv6_accept_ra_use_onlink_prefix = true,
.ipv6_accept_ra_route_table = RT_TABLE_MAIN,
};

View File

@ -209,6 +209,8 @@ struct Network {
uint32_t ipv6_mtu;
bool ipv6_accept_ra_use_dns;
bool ipv6_accept_ra_use_autonomous_prefix;
bool ipv6_accept_ra_use_onlink_prefix;
bool active_slave;
bool primary_slave;
DHCPUseDomains ipv6_accept_ra_use_domains;

View File

@ -177,6 +177,8 @@ Prefix=
UseDomains=
RouteTable=
UseDNS=
UseAutonomousPrefix=
UseOnLinkPrefix=
[DHCPServer]
EmitNTP=
PoolSize=