mirror of
https://github.com/systemd/systemd.git
synced 2025-03-21 02:50:18 +03:00
network: Introduce IPv6RA UseDNR= option
Same as the DHCP v4/v6 options, this controls the use of DNR received from ipv6ra.
This commit is contained in:
parent
0c90d1d2f2
commit
9c683c0e1f
@ -3431,6 +3431,16 @@ Token=prefixstable:2002:da8:1::</programlisting></para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><varname>UseDNR=</varname></term>
|
||||
<listitem>
|
||||
<para> When true, the DNR servers received in the Router Advertisement will be used. Defaults to
|
||||
the value of <option>UseDNS=</option>.</para>
|
||||
|
||||
<xi:include href="version-info.xml" xpointer="v257"/>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><varname>UseDomains=</varname></term>
|
||||
<listitem>
|
||||
|
@ -109,6 +109,9 @@ bool link_get_use_dnr(Link *link, NetworkConfigSource proto) {
|
||||
case NETWORK_CONFIG_SOURCE_DHCP6:
|
||||
n = link->network->dhcp6_use_dnr;
|
||||
break;
|
||||
case NETWORK_CONFIG_SOURCE_NDISC:
|
||||
n = link->network->ndisc_use_dnr;
|
||||
break;
|
||||
default:
|
||||
assert_not_reached();
|
||||
}
|
||||
|
@ -1912,6 +1912,9 @@ static int ndisc_router_process_encrypted_dns(Link *link, sd_ndisc_router *rt) {
|
||||
sd_dns_resolver *res;
|
||||
_cleanup_(ndisc_dnr_freep) NDiscDNR *new_entry = NULL;
|
||||
|
||||
if (!link_get_use_dnr(link, NETWORK_CONFIG_SOURCE_NDISC))
|
||||
return 0;
|
||||
|
||||
r = sd_ndisc_router_get_sender_address(rt, &router);
|
||||
if (r < 0)
|
||||
return log_link_warning_errno(link, r, "Failed to get gateway address from RA: %m");
|
||||
|
@ -309,6 +309,7 @@ IPv6AcceptRA.UseAutonomousPrefix, config_parse_bool,
|
||||
IPv6AcceptRA.UseOnLinkPrefix, config_parse_bool, 0, offsetof(Network, ndisc_use_onlink_prefix)
|
||||
IPv6AcceptRA.UsePREF64, config_parse_bool, 0, offsetof(Network, ndisc_use_pref64)
|
||||
IPv6AcceptRA.UseDNS, config_parse_tristate, 0, offsetof(Network, ndisc_use_dns)
|
||||
IPv6AcceptRA.UseDNR, config_parse_tristate, 0, offsetof(Network, ndisc_use_dnr)
|
||||
IPv6AcceptRA.UseDomains, config_parse_use_domains, 0, offsetof(Network, ndisc_use_domains)
|
||||
IPv6AcceptRA.UseMTU, config_parse_bool, 0, offsetof(Network, ndisc_use_mtu)
|
||||
IPv6AcceptRA.UseHopLimit, config_parse_bool, 0, offsetof(Network, ndisc_use_hop_limit)
|
||||
|
@ -484,6 +484,7 @@ int network_load_one(Manager *manager, OrderedHashmap **networks, const char *fi
|
||||
.ndisc = -1,
|
||||
.ndisc_use_redirect = true,
|
||||
.ndisc_use_dns = -1,
|
||||
.ndisc_use_dnr = -1,
|
||||
.ndisc_use_gateway = true,
|
||||
.ndisc_use_captive_portal = true,
|
||||
.ndisc_use_route_prefix = true,
|
||||
|
@ -345,6 +345,7 @@ struct Network {
|
||||
|
||||
/* NDisc support */
|
||||
int ndisc;
|
||||
int ndisc_use_dnr;
|
||||
bool ndisc_use_redirect;
|
||||
int ndisc_use_dns;
|
||||
bool ndisc_use_gateway;
|
||||
|
Loading…
x
Reference in New Issue
Block a user