network: add DHCPv4.RoutesToDNS= setting
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user