1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2024-12-22 13:33:56 +03:00

network: dhcp6pd: always use main route table for unreachable route

This mostly reverts e47bcb7d0b.
This commit is contained in:
Yu Watanabe 2021-12-05 06:54:03 +09:00
parent 5ed10a194a
commit 2d00239cbe
7 changed files with 7 additions and 46 deletions

View File

@ -2085,7 +2085,6 @@ Table=1234</programlisting></para>
</varlistentry>
<varlistentry>
<term><varname>RouteMetric=</varname></term>
<term><varname>UseDNS=</varname></term>
<term><varname>UseNTP=</varname></term>
<term><varname>UseHostname=</varname></term>

View File

@ -39,15 +39,6 @@ uint32_t link_get_dhcp4_route_table(Link *link) {
return link_get_vrf_table(link);
}
uint32_t link_get_dhcp6_route_table(Link *link) {
assert(link);
assert(link->network);
if (link->network->dhcp6_route_table_set)
return link->network->dhcp6_route_table;
return link_get_vrf_table(link);
}
uint32_t link_get_ipv6_accept_ra_route_table(Link *link) {
assert(link);
assert(link->network);
@ -533,13 +524,9 @@ int config_parse_dhcp_or_ra_route_table(
assert(filename);
assert(lvalue);
assert(IN_SET(ltype,
(RTPROT_DHCP<<16) | AF_UNSPEC,
(RTPROT_DHCP<<16) | AF_INET,
(RTPROT_DHCP<<16) | AF_INET6,
(RTPROT_RA<<16) | AF_INET6));
assert(IN_SET(ltype, AF_INET, AF_INET6));
assert(rvalue);
assert(data);
assert(userdata);
r = safe_atou32(rvalue, &rt);
if (r < 0) {
@ -549,28 +536,11 @@ int config_parse_dhcp_or_ra_route_table(
}
switch(ltype) {
case (RTPROT_DHCP<<16) | AF_INET:
case AF_INET:
network->dhcp_route_table = rt;
network->dhcp_route_table_set = true;
network->dhcp_route_table_set_explicitly = true;
break;
case (RTPROT_DHCP<<16) | AF_INET6:
network->dhcp6_route_table = rt;
network->dhcp6_route_table_set = true;
network->dhcp6_route_table_set_explicitly = true;
break;
case (RTPROT_DHCP<<16) | AF_UNSPEC:
/* For backward compatibility. */
if (!network->dhcp_route_table_set_explicitly) {
network->dhcp_route_table = rt;
network->dhcp_route_table_set = true;
}
if (!network->dhcp6_route_table_set_explicitly) {
network->dhcp6_route_table = rt;
network->dhcp6_route_table_set = true;
}
break;
case (RTPROT_RA<<16) | AF_INET6:
case AF_INET6:
network->ipv6_accept_ra_route_table = rt;
network->ipv6_accept_ra_route_table_set = true;
break;

View File

@ -51,7 +51,6 @@ typedef struct DUID {
} DUID;
uint32_t link_get_dhcp4_route_table(Link *link);
uint32_t link_get_dhcp6_route_table(Link *link);
uint32_t link_get_ipv6_accept_ra_route_table(Link *link);
bool link_dhcp_enabled(Link *link, int family);

View File

@ -698,7 +698,6 @@ static int dhcp6_request_unreachable_route(
route->family = AF_INET6;
route->dst.in6 = *addr;
route->dst_prefixlen = prefixlen;
route->table = link_get_dhcp6_route_table(link);
route->type = RTN_UNREACHABLE;
route->protocol = RTPROT_DHCP;
route->priority = DHCP_ROUTE_METRIC;

View File

@ -228,7 +228,7 @@ DHCPv4.IAID, config_parse_iaid,
DHCPv4.DUIDType, config_parse_network_duid_type, 0, 0
DHCPv4.DUIDRawData, config_parse_network_duid_rawdata, 0, 0
DHCPv4.RouteMetric, config_parse_dhcp_or_ra_route_metric, AF_INET, 0
DHCPv4.RouteTable, config_parse_dhcp_or_ra_route_table, (RTPROT_DHCP<<16) | AF_INET, 0
DHCPv4.RouteTable, config_parse_dhcp_or_ra_route_table, AF_INET, 0
DHCPv4.UseTimezone, config_parse_bool, 0, offsetof(Network, dhcp_use_timezone)
DHCPv4.ListenPort, config_parse_uint16, 0, offsetof(Network, dhcp_client_port)
DHCPv4.SendRelease, config_parse_bool, 0, offsetof(Network, dhcp_send_release)
@ -257,7 +257,6 @@ DHCPv6.SendOption, config_parse_dhcp_send_option,
DHCPv6.IAID, config_parse_iaid, AF_INET6, 0
DHCPv6.DUIDType, config_parse_duid_type, 0, offsetof(Network, dhcp6_duid)
DHCPv6.DUIDRawData, config_parse_duid_rawdata, 0, offsetof(Network, dhcp6_duid)
DHCPv6.RouteTable, config_parse_dhcp_or_ra_route_table, (RTPROT_DHCP<<16) | AF_INET6, 0
IPv6AcceptRA.UseGateway, config_parse_bool, 0, offsetof(Network, ipv6_accept_ra_use_gateway)
IPv6AcceptRA.UseRoutePrefix, config_parse_bool, 0, offsetof(Network, ipv6_accept_ra_use_route_prefix)
IPv6AcceptRA.UseAutonomousPrefix, config_parse_bool, 0, offsetof(Network, ipv6_accept_ra_use_autonomous_prefix)
@ -266,7 +265,7 @@ IPv6AcceptRA.UseDNS, config_parse_bool,
IPv6AcceptRA.UseDomains, config_parse_ipv6_accept_ra_use_domains, 0, offsetof(Network, ipv6_accept_ra_use_domains)
IPv6AcceptRA.UseMTU, config_parse_bool, 0, offsetof(Network, ipv6_accept_ra_use_mtu)
IPv6AcceptRA.DHCPv6Client, config_parse_ipv6_accept_ra_start_dhcp6_client, 0, offsetof(Network, ipv6_accept_ra_start_dhcp6_client)
IPv6AcceptRA.RouteTable, config_parse_dhcp_or_ra_route_table, (RTPROT_RA<<16) | AF_INET6, 0
IPv6AcceptRA.RouteTable, config_parse_dhcp_or_ra_route_table, AF_INET6, 0
IPv6AcceptRA.RouteMetric, config_parse_dhcp_or_ra_route_metric, AF_INET6, 0
IPv6AcceptRA.RouterAllowList, config_parse_in_addr_prefixes, AF_INET6, offsetof(Network, ndisc_allow_listed_router)
IPv6AcceptRA.RouterDenyList, config_parse_in_addr_prefixes, AF_INET6, offsetof(Network, ndisc_deny_listed_router)
@ -543,7 +542,7 @@ DHCP.IAID, config_parse_iaid,
DHCP.DUIDType, config_parse_network_duid_type, 0, 0
DHCP.DUIDRawData, config_parse_network_duid_rawdata, 0, 0
DHCP.RouteMetric, config_parse_dhcp_or_ra_route_metric, AF_UNSPEC, 0
DHCP.RouteTable, config_parse_dhcp_or_ra_route_table, (RTPROT_DHCP<<16) | AF_UNSPEC, 0
DHCP.RouteTable, config_parse_dhcp_or_ra_route_table, AF_INET, 0
DHCP.UseTimezone, config_parse_bool, 0, offsetof(Network, dhcp_use_timezone)
DHCP.ListenPort, config_parse_uint16, 0, offsetof(Network, dhcp_client_port)
DHCP.RapidCommit, config_parse_warn_compat, DISABLED_LEGACY, 0

View File

@ -133,7 +133,6 @@ struct Network {
bool dhcp_route_metric_set;
uint32_t dhcp_route_table;
bool dhcp_route_table_set;
bool dhcp_route_table_set_explicitly;
uint32_t dhcp_fallback_lease_lifetime;
uint32_t dhcp_route_mtu;
uint16_t dhcp_client_port;
@ -172,9 +171,6 @@ struct Network {
bool dhcp6_use_hostname;
bool dhcp6_use_ntp;
bool dhcp6_use_ntp_set;
bool dhcp6_route_table;
bool dhcp6_route_table_set;
bool dhcp6_route_table_set_explicitly;
DHCPUseDomains dhcp6_use_domains;
bool dhcp6_use_domains_set;
uint32_t dhcp6_iaid;

View File

@ -149,7 +149,6 @@ RouteMetric=
IAID=
DUIDType=
DUIDRawData=
RouteTable=
[DHCPv6PrefixDelegation]
UplinkInterface=
SubnetId=