mirror of
https://github.com/systemd/systemd.git
synced 2025-03-28 02:50:16 +03:00
network: move RouteMetric= from [DHCPv6] to [IPv6AcceptRA]
As the value is used in the routes in RA.
This commit is contained in:
parent
415deef9c3
commit
8ebafba9f9
@ -1986,13 +1986,6 @@ IPv6Token=prefixstable:2002:da8:1::</programlisting></para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><varname>RouteMetric=</varname></term>
|
||||
<listitem>
|
||||
<para>Set the routing metric for routes specified by the DHCP server. Defaults to 1024.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><varname>RapidCommit=</varname></term>
|
||||
<listitem>
|
||||
@ -2216,6 +2209,14 @@ IPv6Token=prefixstable:2002:da8:1::</programlisting></para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><varname>RouteMetric=</varname></term>
|
||||
<listitem>
|
||||
<para>Set the routing metric for the routes received in the Router Advertisement. Takes an
|
||||
unsigned integer in the range 0…4294967295. Defaults to 1024.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><varname>UseAutonomousPrefix=</varname></term>
|
||||
<listitem>
|
||||
|
@ -332,14 +332,14 @@ int config_parse_dhcp_route_metric(
|
||||
if (streq_ptr(section, "DHCPv4")) {
|
||||
network->dhcp_route_metric = metric;
|
||||
network->dhcp_route_metric_set = true;
|
||||
} else if (streq_ptr(section, "DHCPv6")) {
|
||||
network->dhcp6_route_metric = metric;
|
||||
network->dhcp6_route_metric_set = true;
|
||||
} else if (STRPTR_IN_SET(section, "DHCPv6", "IPv6AcceptRA")) {
|
||||
network->ipv6_accept_ra_route_metric = metric;
|
||||
network->ipv6_accept_ra_route_metric_set = true;
|
||||
} else { /* [DHCP] section */
|
||||
if (!network->dhcp_route_metric_set)
|
||||
network->dhcp_route_metric = metric;
|
||||
if (!network->dhcp6_route_metric_set)
|
||||
network->dhcp6_route_metric = metric;
|
||||
if (!network->ipv6_accept_ra_route_metric_set)
|
||||
network->ipv6_accept_ra_route_metric = metric;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
@ -530,7 +530,7 @@ static int ndisc_router_process_default(Link *link, sd_ndisc_router *rt) {
|
||||
|
||||
route->family = AF_INET6;
|
||||
route->table = table;
|
||||
route->priority = link->network->dhcp6_route_metric;
|
||||
route->priority = link->network->ipv6_accept_ra_route_metric;
|
||||
route->protocol = RTPROT_RA;
|
||||
route->pref = preference;
|
||||
route->gw_family = AF_INET6;
|
||||
@ -554,7 +554,7 @@ static int ndisc_router_process_default(Link *link, sd_ndisc_router *rt) {
|
||||
if (!route_gw->table_set)
|
||||
route_gw->table = table;
|
||||
if (!route_gw->priority_set)
|
||||
route_gw->priority = link->network->dhcp6_route_metric;
|
||||
route_gw->priority = link->network->ipv6_accept_ra_route_metric;
|
||||
if (!route_gw->protocol_set)
|
||||
route_gw->protocol = RTPROT_RA;
|
||||
if (!route_gw->pref_set)
|
||||
@ -814,7 +814,7 @@ static int ndisc_router_process_onlink_prefix(Link *link, sd_ndisc_router *rt) {
|
||||
|
||||
route->family = AF_INET6;
|
||||
route->table = link_get_ipv6_accept_ra_route_table(link);
|
||||
route->priority = link->network->dhcp6_route_metric;
|
||||
route->priority = link->network->ipv6_accept_ra_route_metric;
|
||||
route->protocol = RTPROT_RA;
|
||||
route->flags = RTM_F_PREFIX;
|
||||
route->dst_prefixlen = prefixlen;
|
||||
@ -899,7 +899,7 @@ static int ndisc_router_process_route(Link *link, sd_ndisc_router *rt) {
|
||||
|
||||
route->family = AF_INET6;
|
||||
route->table = link_get_ipv6_accept_ra_route_table(link);
|
||||
route->priority = link->network->dhcp6_route_metric;
|
||||
route->priority = link->network->ipv6_accept_ra_route_metric;
|
||||
route->protocol = RTPROT_RA;
|
||||
route->pref = preference;
|
||||
route->gw = gateway;
|
||||
|
@ -244,13 +244,13 @@ DHCPv6.ForceDHCPv6PDOtherInformation, config_parse_bool,
|
||||
DHCPv6.PrefixDelegationHint, config_parse_dhcp6_pd_hint, 0, 0
|
||||
DHCPv6.WithoutRA, config_parse_dhcp6_client_start_mode, 0, offsetof(Network, dhcp6_without_ra)
|
||||
DHCPv6.SendOption, config_parse_dhcp_send_option, AF_INET6, offsetof(Network, dhcp6_client_send_options)
|
||||
DHCPv6.RouteMetric, config_parse_dhcp_route_metric, 0, 0
|
||||
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_ipv6_accept_ra_use_domains, 0, offsetof(Network, ipv6_accept_ra_use_domains)
|
||||
IPv6AcceptRA.DHCPv6Client, config_parse_ipv6_accept_ra_start_dhcp6_client, 0, offsetof(Network, ipv6_accept_ra_start_dhcp6_client)
|
||||
IPv6AcceptRA.RouteTable, config_parse_section_route_table, 0, 0
|
||||
IPv6AcceptRA.RouteMetric, config_parse_dhcp_route_metric, 0, 0
|
||||
IPv6AcceptRA.RouterAllowList, config_parse_ndisc_address_filter, 0, offsetof(Network, ndisc_allow_listed_router)
|
||||
IPv6AcceptRA.RouterDenyList, config_parse_ndisc_address_filter, 0, offsetof(Network, ndisc_deny_listed_router)
|
||||
IPv6AcceptRA.PrefixAllowList, config_parse_ndisc_address_filter, 0, offsetof(Network, ndisc_allow_listed_prefix)
|
||||
@ -492,6 +492,7 @@ DHCP.RapidCommit, config_parse_bool,
|
||||
DHCP.ForceDHCPv6PDOtherInformation, config_parse_bool, 0, offsetof(Network, dhcp6_force_pd_other_information)
|
||||
DHCPv4.UseDomainName, config_parse_dhcp_use_domains, 0, 0
|
||||
DHCPv4.CriticalConnection, config_parse_tristate, 0, offsetof(Network, dhcp_critical)
|
||||
DHCPv6.RouteMetric, config_parse_dhcp_route_metric, 0, 0
|
||||
IPv6AcceptRA.DenyList, config_parse_ndisc_address_filter, 0, offsetof(Network, ndisc_deny_listed_prefix)
|
||||
IPv6AcceptRA.BlackList, config_parse_ndisc_address_filter, 0, offsetof(Network, ndisc_deny_listed_prefix)
|
||||
TrafficControlQueueingDiscipline.Parent, config_parse_qdisc_parent, _QDISC_KIND_INVALID, 0
|
||||
|
@ -321,7 +321,6 @@ int network_load_one(Manager *manager, OrderedHashmap **networks, const char *fi
|
||||
.dhcp6_use_hostname = true,
|
||||
.dhcp6_use_ntp = true,
|
||||
.dhcp6_rapid_commit = true,
|
||||
.dhcp6_route_metric = DHCP_ROUTE_METRIC,
|
||||
|
||||
.dhcp6_pd = -1,
|
||||
.dhcp6_pd_announce = true,
|
||||
@ -379,6 +378,7 @@ int network_load_one(Manager *manager, OrderedHashmap **networks, const char *fi
|
||||
.ipv6_accept_ra_use_autonomous_prefix = true,
|
||||
.ipv6_accept_ra_use_onlink_prefix = true,
|
||||
.ipv6_accept_ra_route_table = RT_TABLE_MAIN,
|
||||
.ipv6_accept_ra_route_metric = DHCP_ROUTE_METRIC,
|
||||
.ipv6_accept_ra_start_dhcp6_client = IPV6_ACCEPT_RA_START_DHCP6_CLIENT_YES,
|
||||
|
||||
.can_triple_sampling = -1,
|
||||
|
@ -170,8 +170,6 @@ struct Network {
|
||||
DHCPUseDomains dhcp6_use_domains;
|
||||
bool dhcp6_use_domains_set;
|
||||
uint8_t dhcp6_pd_length;
|
||||
uint32_t dhcp6_route_metric;
|
||||
bool dhcp6_route_metric_set;
|
||||
char *dhcp6_mudurl;
|
||||
char **dhcp6_user_class;
|
||||
char **dhcp6_vendor_class;
|
||||
@ -277,10 +275,12 @@ struct Network {
|
||||
bool ipv6_accept_ra_use_onlink_prefix;
|
||||
bool active_slave;
|
||||
bool primary_slave;
|
||||
bool ipv6_accept_ra_route_table_set;
|
||||
DHCPUseDomains ipv6_accept_ra_use_domains;
|
||||
IPv6AcceptRAStartDHCP6Client ipv6_accept_ra_start_dhcp6_client;
|
||||
uint32_t ipv6_accept_ra_route_table;
|
||||
bool ipv6_accept_ra_route_table_set;
|
||||
uint32_t ipv6_accept_ra_route_metric;
|
||||
bool ipv6_accept_ra_route_metric_set;
|
||||
Set *ndisc_deny_listed_router;
|
||||
Set *ndisc_allow_listed_router;
|
||||
Set *ndisc_deny_listed_prefix;
|
||||
|
@ -318,6 +318,7 @@ Prefix=
|
||||
[IPv6AcceptRA]
|
||||
UseDomains=
|
||||
RouteTable=
|
||||
RouteMetric=
|
||||
UseDNS=
|
||||
DHCPv6Client=
|
||||
UseAutonomousPrefix=
|
||||
|
Loading…
x
Reference in New Issue
Block a user