mirror of
https://github.com/systemd/systemd.git
synced 2024-12-23 21:35:11 +03:00
network: add DHCPv4.RoutesToDNS= setting
This commit is contained in:
parent
854a1ccfc2
commit
a24e12f020
@ -1322,6 +1322,14 @@
|
||||
project='man-pages'><refentrytitle>resolv.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><varname>RoutesToDNS=</varname></term>
|
||||
<listitem>
|
||||
<para>When true, the routes to the DNS servers received from the DHCP server will be
|
||||
configured. When <varname>UseDNS=</varname> is disabled, this setting is ignored.
|
||||
Defaults to <literal>false</literal></para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><varname>UseNTP=</varname></term>
|
||||
<listitem>
|
||||
|
@ -118,7 +118,8 @@ static int link_set_dns_routes(Link *link, const struct in_addr *address) {
|
||||
assert(link->dhcp_lease);
|
||||
assert(link->network);
|
||||
|
||||
if (!link->network->dhcp_use_dns)
|
||||
if (!link->network->dhcp_use_dns ||
|
||||
!link->network->dhcp_routes_to_dns)
|
||||
return 0;
|
||||
|
||||
n = sd_dhcp_lease_get_dns(link->dhcp_lease, &dns);
|
||||
@ -408,7 +409,8 @@ static int dhcp_remove_dns_routes(Link *link, sd_dhcp_lease *lease, const struct
|
||||
assert(lease);
|
||||
assert(link->network);
|
||||
|
||||
if (!link->network->dhcp_use_dns)
|
||||
if (!link->network->dhcp_use_dns ||
|
||||
!link->network->dhcp_routes_to_dns)
|
||||
return 0;
|
||||
|
||||
n = sd_dhcp_lease_get_dns(lease, &dns);
|
||||
|
@ -142,6 +142,7 @@ Route.FastOpenNoCookie, config_parse_fast_open_no_cookie,
|
||||
Route.TTLPropagate, config_parse_route_ttl_propagate, 0, 0
|
||||
DHCPv4.ClientIdentifier, config_parse_dhcp_client_identifier, 0, offsetof(Network, dhcp_client_identifier)
|
||||
DHCPv4.UseDNS, config_parse_bool, 0, offsetof(Network, dhcp_use_dns)
|
||||
DHCPv4.RoutesToDNS, config_parse_bool, 0, offsetof(Network, dhcp_routes_to_dns)
|
||||
DHCPv4.UseNTP, config_parse_bool, 0, offsetof(Network, dhcp_use_ntp)
|
||||
DHCPv4.UseMTU, config_parse_bool, 0, offsetof(Network, dhcp_use_mtu)
|
||||
DHCPv4.UseHostname, config_parse_bool, 0, offsetof(Network, dhcp_use_hostname)
|
||||
|
@ -91,6 +91,7 @@ struct Network {
|
||||
bool dhcp_broadcast;
|
||||
int dhcp_critical;
|
||||
bool dhcp_use_dns;
|
||||
bool dhcp_routes_to_dns;
|
||||
bool dhcp_use_ntp;
|
||||
bool dhcp_use_mtu;
|
||||
bool dhcp_use_routes;
|
||||
|
@ -69,6 +69,7 @@ SendRelease=
|
||||
MaxAttempts=
|
||||
[DHCPv4]
|
||||
UseDNS=
|
||||
RoutesToDNS=
|
||||
UseDomains=
|
||||
UseRoutes=
|
||||
IAID=
|
||||
|
Loading…
Reference in New Issue
Block a user