mirror of
https://github.com/systemd/systemd.git
synced 2026-08-03 14:40:31 +00:00
network/ndisc: rename Network.ipv6_accept_ra -> Network.ndisc
These settings are leated to sd-ndisc and Neighbor Discovery protocol. Let's use more suitable name.
This commit is contained in:
committed by
Zbigniew Jędrzejewski-Szmek
parent
e66c7eb6db
commit
52672db3f8
@@ -40,12 +40,12 @@ uint32_t link_get_dhcp4_route_table(Link *link) {
|
||||
return link_get_vrf_table(link);
|
||||
}
|
||||
|
||||
uint32_t link_get_ipv6_accept_ra_route_table(Link *link) {
|
||||
uint32_t link_get_ndisc_route_table(Link *link) {
|
||||
assert(link);
|
||||
assert(link->network);
|
||||
|
||||
if (link->network->ipv6_accept_ra_route_table_set)
|
||||
return link->network->ipv6_accept_ra_route_table;
|
||||
if (link->network->ndisc_route_table_set)
|
||||
return link->network->ndisc_route_table;
|
||||
return link_get_vrf_table(link);
|
||||
}
|
||||
|
||||
@@ -281,7 +281,7 @@ int link_get_captive_portal(Link *link, const char **ret) {
|
||||
return r;
|
||||
}
|
||||
|
||||
if (link->network->ipv6_accept_ra_use_captive_portal) {
|
||||
if (link->network->ndisc_use_captive_portal) {
|
||||
NDiscCaptivePortal *cp;
|
||||
usec_t usec = 0;
|
||||
|
||||
@@ -409,10 +409,10 @@ int config_parse_dhcp_route_metric(
|
||||
/* For backward compatibility. */
|
||||
if (!network->dhcp_route_metric_set)
|
||||
network->dhcp_route_metric = metric;
|
||||
if (!network->ipv6_accept_ra_route_metric_set) {
|
||||
network->ipv6_accept_ra_route_metric_high = metric;
|
||||
network->ipv6_accept_ra_route_metric_medium = metric;
|
||||
network->ipv6_accept_ra_route_metric_low = metric;
|
||||
if (!network->ndisc_route_metric_set) {
|
||||
network->ndisc_route_metric_high = metric;
|
||||
network->ndisc_route_metric_medium = metric;
|
||||
network->ndisc_route_metric_low = metric;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
@@ -422,7 +422,7 @@ int config_parse_dhcp_route_metric(
|
||||
return 0;
|
||||
}
|
||||
|
||||
int config_parse_ipv6_accept_ra_route_metric(
|
||||
int config_parse_ndisc_route_metric(
|
||||
const char *unit,
|
||||
const char *filename,
|
||||
unsigned line,
|
||||
@@ -472,10 +472,10 @@ int config_parse_ipv6_accept_ra_route_metric(
|
||||
}
|
||||
}
|
||||
|
||||
network->ipv6_accept_ra_route_metric_high = metric_high;
|
||||
network->ipv6_accept_ra_route_metric_medium = metric_medium;
|
||||
network->ipv6_accept_ra_route_metric_low = metric_low;
|
||||
network->ipv6_accept_ra_route_metric_set = true;
|
||||
network->ndisc_route_metric_high = metric_high;
|
||||
network->ndisc_route_metric_medium = metric_medium;
|
||||
network->ndisc_route_metric_low = metric_low;
|
||||
network->ndisc_route_metric_set = true;
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -717,8 +717,8 @@ int config_parse_dhcp_or_ra_route_table(
|
||||
network->dhcp_route_table_set = true;
|
||||
break;
|
||||
case AF_INET6:
|
||||
network->ipv6_accept_ra_route_table = rt;
|
||||
network->ipv6_accept_ra_route_table_set = true;
|
||||
network->ndisc_route_table = rt;
|
||||
network->ndisc_route_table_set = true;
|
||||
break;
|
||||
default:
|
||||
assert_not_reached();
|
||||
|
||||
@@ -54,7 +54,7 @@ typedef struct DUID {
|
||||
} DUID;
|
||||
|
||||
uint32_t link_get_dhcp4_route_table(Link *link);
|
||||
uint32_t link_get_ipv6_accept_ra_route_table(Link *link);
|
||||
uint32_t link_get_ndisc_route_table(Link *link);
|
||||
|
||||
bool link_dhcp_enabled(Link *link, int family);
|
||||
static inline bool link_dhcp4_enabled(Link *link) {
|
||||
@@ -95,7 +95,7 @@ DHCPOptionDataType dhcp_option_data_type_from_string(const char *d) _pure_;
|
||||
|
||||
CONFIG_PARSER_PROTOTYPE(config_parse_dhcp);
|
||||
CONFIG_PARSER_PROTOTYPE(config_parse_dhcp_route_metric);
|
||||
CONFIG_PARSER_PROTOTYPE(config_parse_ipv6_accept_ra_route_metric);
|
||||
CONFIG_PARSER_PROTOTYPE(config_parse_ndisc_route_metric);
|
||||
CONFIG_PARSER_PROTOTYPE(config_parse_dhcp_send_hostname);
|
||||
CONFIG_PARSER_PROTOTYPE(config_parse_dhcp_use_dns);
|
||||
CONFIG_PARSER_PROTOTYPE(config_parse_dhcp_use_domains);
|
||||
|
||||
@@ -799,7 +799,7 @@ int link_request_dhcp6_client(Link *link) {
|
||||
|
||||
assert(link);
|
||||
|
||||
if (!link_dhcp6_enabled(link) && !link_ipv6_accept_ra_enabled(link))
|
||||
if (!link_dhcp6_enabled(link) && !link_ndisc_enabled(link))
|
||||
return 0;
|
||||
|
||||
if (link->dhcp6_client)
|
||||
|
||||
@@ -490,7 +490,7 @@ static int dns_append_json(Link *link, JsonVariant **v) {
|
||||
}
|
||||
}
|
||||
|
||||
if (link->network->ipv6_accept_ra_use_dns) {
|
||||
if (link->network->ndisc_use_dns) {
|
||||
NDiscRDNSS *a;
|
||||
|
||||
SET_FOREACH(a, link->ndisc_rdnss) {
|
||||
@@ -730,7 +730,7 @@ static int domains_append_json(Link *link, bool is_route, JsonVariant **v) {
|
||||
}
|
||||
}
|
||||
|
||||
if (link->network->ipv6_accept_ra_use_domains == use_domains) {
|
||||
if (link->network->ndisc_use_domains == use_domains) {
|
||||
NDiscDNSSL *a;
|
||||
|
||||
SET_FOREACH(a, link->ndisc_dnssl) {
|
||||
@@ -869,7 +869,7 @@ static int pref64_append_json(Link *link, JsonVariant **v) {
|
||||
assert(link);
|
||||
assert(v);
|
||||
|
||||
if (!link->network || !link->network->ipv6_accept_ra_use_pref64)
|
||||
if (!link->network || !link->network->ndisc_use_pref64)
|
||||
return 0;
|
||||
|
||||
SET_FOREACH(i, link->ndisc_pref64) {
|
||||
|
||||
@@ -541,7 +541,7 @@ void link_check_ready(Link *link) {
|
||||
* Note, ignore NDisc when ConfigureWithoutCarrier= is enabled, as IPv6AcceptRA= is enabled by default. */
|
||||
if (!link_ipv4ll_enabled(link) && !link_dhcp4_enabled(link) &&
|
||||
!link_dhcp6_enabled(link) && !link_dhcp_pd_is_enabled(link) &&
|
||||
(link->network->configure_without_carrier || !link_ipv6_accept_ra_enabled(link)))
|
||||
(link->network->configure_without_carrier || !link_ndisc_enabled(link)))
|
||||
goto ready;
|
||||
|
||||
bool ipv4ll_ready =
|
||||
@@ -559,8 +559,8 @@ void link_check_ready(Link *link) {
|
||||
(!link->network->dhcp_pd_assign ||
|
||||
link_check_addresses_ready(link, NETWORK_CONFIG_SOURCE_DHCP_PD));
|
||||
bool ndisc_ready =
|
||||
link_ipv6_accept_ra_enabled(link) && link->ndisc_configured &&
|
||||
(!link->network->ipv6_accept_ra_use_autonomous_prefix ||
|
||||
link_ndisc_enabled(link) && link->ndisc_configured &&
|
||||
(!link->network->ndisc_use_autonomous_prefix ||
|
||||
link_check_addresses_ready(link, NETWORK_CONFIG_SOURCE_NDISC));
|
||||
|
||||
/* If the uplink for PD is self, then request the corresponding DHCP protocol is also ready. */
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
* Not sure if the threshold is high enough. Let's adjust later if not. */
|
||||
#define NDISC_PREF64_MAX 64U
|
||||
|
||||
bool link_ipv6_accept_ra_enabled(Link *link) {
|
||||
bool link_ndisc_enabled(Link *link) {
|
||||
assert(link);
|
||||
|
||||
if (!socket_ipv6_is_supported())
|
||||
@@ -53,8 +53,8 @@ bool link_ipv6_accept_ra_enabled(Link *link) {
|
||||
if (!link_may_have_ipv6ll(link, /* check_multicast = */ true))
|
||||
return false;
|
||||
|
||||
if (link->network->ipv6_accept_ra >= 0)
|
||||
return link->network->ipv6_accept_ra;
|
||||
if (link->network->ndisc >= 0)
|
||||
return link->network->ndisc;
|
||||
|
||||
/* Accept RAs if IPv6 forwarding is disabled, and ignore RAs if IPv6 forwarding is enabled. */
|
||||
int t = link_get_ip_forwarding(link, AF_INET6);
|
||||
@@ -65,14 +65,14 @@ bool link_ipv6_accept_ra_enabled(Link *link) {
|
||||
return true;
|
||||
}
|
||||
|
||||
void network_adjust_ipv6_accept_ra(Network *network) {
|
||||
void network_adjust_ndisc(Network *network) {
|
||||
assert(network);
|
||||
|
||||
if (!FLAGS_SET(network->link_local, ADDRESS_FAMILY_IPV6)) {
|
||||
if (network->ipv6_accept_ra > 0)
|
||||
if (network->ndisc > 0)
|
||||
log_warning("%s: IPv6AcceptRA= is enabled but IPv6 link-local addressing is disabled or not supported. "
|
||||
"Disabling IPv6AcceptRA=.", network->filename);
|
||||
network->ipv6_accept_ra = false;
|
||||
network->ndisc = false;
|
||||
}
|
||||
|
||||
/* When RouterAllowList=, PrefixAllowList= or RouteAllowList= are specified, then
|
||||
@@ -164,13 +164,13 @@ static void ndisc_set_route_priority(Link *link, Route *route) {
|
||||
|
||||
switch (route->pref) {
|
||||
case SD_NDISC_PREFERENCE_LOW:
|
||||
route->priority = link->network->ipv6_accept_ra_route_metric_low;
|
||||
route->priority = link->network->ndisc_route_metric_low;
|
||||
break;
|
||||
case SD_NDISC_PREFERENCE_MEDIUM:
|
||||
route->priority = link->network->ipv6_accept_ra_route_metric_medium;
|
||||
route->priority = link->network->ndisc_route_metric_medium;
|
||||
break;
|
||||
case SD_NDISC_PREFERENCE_HIGH:
|
||||
route->priority = link->network->ipv6_accept_ra_route_metric_high;
|
||||
route->priority = link->network->ndisc_route_metric_high;
|
||||
break;
|
||||
default:
|
||||
assert_not_reached();
|
||||
@@ -194,13 +194,13 @@ static int ndisc_request_route(Route *route, Link *link, sd_ndisc_router *rt) {
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
if (link->network->ipv6_accept_ra_use_mtu) {
|
||||
if (link->network->ndisc_use_mtu) {
|
||||
r = sd_ndisc_router_get_mtu(rt, &mtu);
|
||||
if (r < 0 && r != -ENODATA)
|
||||
return log_link_warning_errno(link, r, "Failed to get MTU from RA: %m");
|
||||
}
|
||||
|
||||
if (link->network->ipv6_accept_ra_use_hop_limit) {
|
||||
if (link->network->ndisc_use_hop_limit) {
|
||||
r = sd_ndisc_router_get_hop_limit(rt, &hop_limit);
|
||||
if (r < 0 && r != -ENODATA)
|
||||
return log_link_warning_errno(link, r, "Failed to get hop limit from RA: %m");
|
||||
@@ -209,7 +209,7 @@ static int ndisc_request_route(Route *route, Link *link, sd_ndisc_router *rt) {
|
||||
route->source = NETWORK_CONFIG_SOURCE_NDISC;
|
||||
route->provider.in6 = router;
|
||||
if (!route->table_set)
|
||||
route->table = link_get_ipv6_accept_ra_route_table(link);
|
||||
route->table = link_get_ndisc_route_table(link);
|
||||
if (!route->protocol_set)
|
||||
route->protocol = RTPROT_RA;
|
||||
r = route_metric_set(&route->metric, RTAX_MTU, mtu);
|
||||
@@ -218,7 +218,7 @@ static int ndisc_request_route(Route *route, Link *link, sd_ndisc_router *rt) {
|
||||
r = route_metric_set(&route->metric, RTAX_HOPLIMIT, hop_limit);
|
||||
if (r < 0)
|
||||
return r;
|
||||
r = route_metric_set(&route->metric, RTAX_QUICKACK, link->network->ipv6_accept_ra_quickack);
|
||||
r = route_metric_set(&route->metric, RTAX_QUICKACK, link->network->ndisc_quickack);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
@@ -288,7 +288,7 @@ static int ndisc_remove_route(Route *route, Link *link) {
|
||||
ndisc_set_route_priority(link, route);
|
||||
|
||||
if (!route->table_set)
|
||||
route->table = link_get_ipv6_accept_ra_route_table(link);
|
||||
route->table = link_get_ndisc_route_table(link);
|
||||
|
||||
r = route_adjust_nexthops(route, link);
|
||||
if (r < 0)
|
||||
@@ -444,7 +444,7 @@ static int ndisc_router_process_default(Link *link, sd_ndisc_router *rt) {
|
||||
if (r == 0)
|
||||
return ndisc_router_drop_default(link, rt);
|
||||
|
||||
if (!link->network->ipv6_accept_ra_use_gateway &&
|
||||
if (!link->network->ndisc_use_gateway &&
|
||||
hashmap_isempty(link->network->routes_by_section))
|
||||
return 0;
|
||||
|
||||
@@ -467,7 +467,7 @@ static int ndisc_router_process_default(Link *link, sd_ndisc_router *rt) {
|
||||
if (r < 0)
|
||||
return log_link_warning_errno(link, r, "Failed to get router preference from RA: %m");
|
||||
|
||||
if (link->network->ipv6_accept_ra_use_gateway) {
|
||||
if (link->network->ndisc_use_gateway) {
|
||||
_cleanup_(route_unrefp) Route *route = NULL;
|
||||
|
||||
r = route_new(&route);
|
||||
@@ -520,7 +520,7 @@ static int ndisc_router_process_icmp6_ratelimit(Link *link, sd_ndisc_router *rt)
|
||||
assert(link->network);
|
||||
assert(rt);
|
||||
|
||||
if (!link->network->ipv6_accept_ra_use_icmp6_ratelimit)
|
||||
if (!link->network->ndisc_use_icmp6_ratelimit)
|
||||
return 0;
|
||||
|
||||
/* Ignore the icmp6 ratelimit field of the RA header if the lifetime is zero. */
|
||||
@@ -557,7 +557,7 @@ static int ndisc_router_process_reachable_time(Link *link, sd_ndisc_router *rt)
|
||||
assert(link->network);
|
||||
assert(rt);
|
||||
|
||||
if (!link->network->ipv6_accept_ra_use_reachable_time)
|
||||
if (!link->network->ndisc_use_reachable_time)
|
||||
return 0;
|
||||
|
||||
/* Ignore the reachable time field of the RA header if the lifetime is zero. */
|
||||
@@ -595,7 +595,7 @@ static int ndisc_router_process_retransmission_time(Link *link, sd_ndisc_router
|
||||
assert(link->network);
|
||||
assert(rt);
|
||||
|
||||
if (!link->network->ipv6_accept_ra_use_retransmission_time)
|
||||
if (!link->network->ndisc_use_retransmission_time)
|
||||
return 0;
|
||||
|
||||
/* Ignore the retransmission time field of the RA header if the lifetime is zero. */
|
||||
@@ -633,7 +633,7 @@ static int ndisc_router_process_hop_limit(Link *link, sd_ndisc_router *rt) {
|
||||
assert(link->network);
|
||||
assert(rt);
|
||||
|
||||
if (!link->network->ipv6_accept_ra_use_hop_limit)
|
||||
if (!link->network->ndisc_use_hop_limit)
|
||||
return 0;
|
||||
|
||||
/* Ignore the hop limit field of the RA header if the lifetime is zero. */
|
||||
@@ -676,7 +676,7 @@ static int ndisc_router_process_autonomous_prefix(Link *link, sd_ndisc_router *r
|
||||
assert(link->network);
|
||||
assert(rt);
|
||||
|
||||
if (!link->network->ipv6_accept_ra_use_autonomous_prefix)
|
||||
if (!link->network->ndisc_use_autonomous_prefix)
|
||||
return 0;
|
||||
|
||||
r = sd_ndisc_router_prefix_get_address(rt, &prefix);
|
||||
@@ -756,7 +756,7 @@ static int ndisc_router_process_onlink_prefix(Link *link, sd_ndisc_router *rt) {
|
||||
assert(link->network);
|
||||
assert(rt);
|
||||
|
||||
if (!link->network->ipv6_accept_ra_use_onlink_prefix)
|
||||
if (!link->network->ndisc_use_onlink_prefix)
|
||||
return 0;
|
||||
|
||||
r = sd_ndisc_router_prefix_get_valid_lifetime_timestamp(rt, CLOCK_BOOTTIME, &lifetime_usec);
|
||||
@@ -810,7 +810,7 @@ static int ndisc_router_drop_onlink_prefix(Link *link, sd_ndisc_router *rt) {
|
||||
* covered by the prefix are off-link. The only way to cancel a previous on-link indication is to
|
||||
* advertise that prefix with the L-bit set and the Lifetime set to zero. */
|
||||
|
||||
if (!link->network->ipv6_accept_ra_use_onlink_prefix)
|
||||
if (!link->network->ndisc_use_onlink_prefix)
|
||||
return 0;
|
||||
|
||||
r = sd_ndisc_router_prefix_get_valid_lifetime(rt, &lifetime_usec);
|
||||
@@ -907,7 +907,7 @@ static int ndisc_router_process_route(Link *link, sd_ndisc_router *rt) {
|
||||
|
||||
assert(link);
|
||||
|
||||
if (!link->network->ipv6_accept_ra_use_route_prefix)
|
||||
if (!link->network->ndisc_use_route_prefix)
|
||||
return 0;
|
||||
|
||||
r = sd_ndisc_router_route_get_lifetime_timestamp(rt, CLOCK_BOOTTIME, &lifetime_usec);
|
||||
@@ -1003,7 +1003,7 @@ static int ndisc_router_process_rdnss(Link *link, sd_ndisc_router *rt) {
|
||||
assert(link->network);
|
||||
assert(rt);
|
||||
|
||||
if (!link->network->ipv6_accept_ra_use_dns)
|
||||
if (!link->network->ndisc_use_dns)
|
||||
return 0;
|
||||
|
||||
r = sd_ndisc_router_get_address(rt, &router);
|
||||
@@ -1095,7 +1095,7 @@ static int ndisc_router_process_dnssl(Link *link, sd_ndisc_router *rt) {
|
||||
assert(link->network);
|
||||
assert(rt);
|
||||
|
||||
if (link->network->ipv6_accept_ra_use_domains == DHCP_USE_DOMAINS_NO)
|
||||
if (link->network->ndisc_use_domains == DHCP_USE_DOMAINS_NO)
|
||||
return 0;
|
||||
|
||||
r = sd_ndisc_router_get_address(rt, &router);
|
||||
@@ -1200,7 +1200,7 @@ static int ndisc_router_process_captive_portal(Link *link, sd_ndisc_router *rt)
|
||||
assert(link->network);
|
||||
assert(rt);
|
||||
|
||||
if (!link->network->ipv6_accept_ra_use_captive_portal)
|
||||
if (!link->network->ndisc_use_captive_portal)
|
||||
return 0;
|
||||
|
||||
r = sd_ndisc_router_get_address(rt, &router);
|
||||
@@ -1320,7 +1320,7 @@ static int ndisc_router_process_pref64(Link *link, sd_ndisc_router *rt) {
|
||||
assert(link->network);
|
||||
assert(rt);
|
||||
|
||||
if (!link->network->ipv6_accept_ra_use_pref64)
|
||||
if (!link->network->ndisc_use_pref64)
|
||||
return 0;
|
||||
|
||||
r = sd_ndisc_router_get_address(rt, &router);
|
||||
@@ -1614,7 +1614,7 @@ static int ndisc_start_dhcp6_client(Link *link, sd_ndisc_router *rt) {
|
||||
if (r <= 0)
|
||||
return r;
|
||||
|
||||
switch (link->network->ipv6_accept_ra_start_dhcp6_client) {
|
||||
switch (link->network->ndisc_start_dhcp6_client) {
|
||||
case IPV6_ACCEPT_RA_START_DHCP6_CLIENT_NO:
|
||||
return 0;
|
||||
|
||||
@@ -1770,7 +1770,7 @@ static int ndisc_configure(Link *link) {
|
||||
|
||||
assert(link);
|
||||
|
||||
if (!link_ipv6_accept_ra_enabled(link))
|
||||
if (!link_ndisc_enabled(link))
|
||||
return 0;
|
||||
|
||||
if (link->ndisc)
|
||||
@@ -1850,7 +1850,7 @@ int link_request_ndisc(Link *link) {
|
||||
|
||||
assert(link);
|
||||
|
||||
if (!link_ipv6_accept_ra_enabled(link))
|
||||
if (!link_ndisc_enabled(link))
|
||||
return 0;
|
||||
|
||||
if (link->ndisc)
|
||||
@@ -1885,15 +1885,15 @@ void ndisc_flush(Link *link) {
|
||||
link->ndisc_pref64 = set_free(link->ndisc_pref64);
|
||||
}
|
||||
|
||||
static const char* const ipv6_accept_ra_start_dhcp6_client_table[_IPV6_ACCEPT_RA_START_DHCP6_CLIENT_MAX] = {
|
||||
static const char* const ndisc_start_dhcp6_client_table[_IPV6_ACCEPT_RA_START_DHCP6_CLIENT_MAX] = {
|
||||
[IPV6_ACCEPT_RA_START_DHCP6_CLIENT_NO] = "no",
|
||||
[IPV6_ACCEPT_RA_START_DHCP6_CLIENT_ALWAYS] = "always",
|
||||
[IPV6_ACCEPT_RA_START_DHCP6_CLIENT_YES] = "yes",
|
||||
};
|
||||
|
||||
DEFINE_PRIVATE_STRING_TABLE_LOOKUP_FROM_STRING_WITH_BOOLEAN(ipv6_accept_ra_start_dhcp6_client, IPv6AcceptRAStartDHCP6Client, IPV6_ACCEPT_RA_START_DHCP6_CLIENT_YES);
|
||||
DEFINE_PRIVATE_STRING_TABLE_LOOKUP_FROM_STRING_WITH_BOOLEAN(ndisc_start_dhcp6_client, IPv6AcceptRAStartDHCP6Client, IPV6_ACCEPT_RA_START_DHCP6_CLIENT_YES);
|
||||
|
||||
DEFINE_CONFIG_PARSE_ENUM(config_parse_ipv6_accept_ra_use_domains, dhcp_use_domains, DHCPUseDomains,
|
||||
DEFINE_CONFIG_PARSE_ENUM(config_parse_ndisc_use_domains, dhcp_use_domains, DHCPUseDomains,
|
||||
"Failed to parse UseDomains= setting");
|
||||
DEFINE_CONFIG_PARSE_ENUM(config_parse_ipv6_accept_ra_start_dhcp6_client, ipv6_accept_ra_start_dhcp6_client, IPv6AcceptRAStartDHCP6Client,
|
||||
DEFINE_CONFIG_PARSE_ENUM(config_parse_ndisc_start_dhcp6_client, ndisc_start_dhcp6_client, IPv6AcceptRAStartDHCP6Client,
|
||||
"Failed to parse DHCPv6Client= setting");
|
||||
|
||||
@@ -52,9 +52,9 @@ static inline char* NDISC_DNSSL_DOMAIN(const NDiscDNSSL *n) {
|
||||
return ((char*) n) + ALIGN(sizeof(NDiscDNSSL));
|
||||
}
|
||||
|
||||
bool link_ipv6_accept_ra_enabled(Link *link);
|
||||
bool link_ndisc_enabled(Link *link);
|
||||
|
||||
void network_adjust_ipv6_accept_ra(Network *network);
|
||||
void network_adjust_ndisc(Network *network);
|
||||
|
||||
int ndisc_start(Link *link);
|
||||
int ndisc_stop(Link *link);
|
||||
@@ -62,5 +62,5 @@ void ndisc_flush(Link *link);
|
||||
|
||||
int link_request_ndisc(Link *link);
|
||||
|
||||
CONFIG_PARSER_PROTOTYPE(config_parse_ipv6_accept_ra_start_dhcp6_client);
|
||||
CONFIG_PARSER_PROTOTYPE(config_parse_ipv6_accept_ra_use_domains);
|
||||
CONFIG_PARSER_PROTOTYPE(config_parse_ndisc_start_dhcp6_client);
|
||||
CONFIG_PARSER_PROTOTYPE(config_parse_ndisc_use_domains);
|
||||
|
||||
@@ -129,8 +129,8 @@ Network.IPv4Forwarding, config_parse_tristate,
|
||||
Network.IPv6Forwarding, config_parse_tristate, 0, offsetof(Network, ip_forwarding[1])
|
||||
Network.IPMasquerade, config_parse_ip_masquerade, 0, offsetof(Network, ip_masquerade)
|
||||
Network.IPv6PrivacyExtensions, config_parse_ipv6_privacy_extensions, 0, offsetof(Network, ipv6_privacy_extensions)
|
||||
Network.IPv6AcceptRA, config_parse_tristate, 0, offsetof(Network, ipv6_accept_ra)
|
||||
Network.IPv6AcceptRouterAdvertisements, config_parse_tristate, 0, offsetof(Network, ipv6_accept_ra)
|
||||
Network.IPv6AcceptRA, config_parse_tristate, 0, offsetof(Network, ndisc)
|
||||
Network.IPv6AcceptRouterAdvertisements, config_parse_tristate, 0, offsetof(Network, ndisc)
|
||||
Network.IPv6DuplicateAddressDetection, config_parse_int, 0, offsetof(Network, ipv6_dad_transmits)
|
||||
Network.IPv6HopLimit, config_parse_uint8, 0, offsetof(Network, ipv6_hop_limit)
|
||||
Network.IPv6RetransmissionTimeSec, config_parse_sec, 0, offsetof(Network, ipv6_retransmission_time)
|
||||
@@ -292,23 +292,23 @@ DHCPv6.RapidCommit, config_parse_bool,
|
||||
DHCPv6.NetLabel, config_parse_string, CONFIG_PARSE_STRING_SAFE, offsetof(Network, dhcp6_netlabel)
|
||||
DHCPv6.SendRelease, config_parse_bool, 0, offsetof(Network, dhcp6_send_release)
|
||||
DHCPv6.NFTSet, config_parse_nft_set, NFT_SET_PARSE_NETWORK, offsetof(Network, dhcp6_nft_set_context)
|
||||
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)
|
||||
IPv6AcceptRA.UseOnLinkPrefix, config_parse_bool, 0, offsetof(Network, ipv6_accept_ra_use_onlink_prefix)
|
||||
IPv6AcceptRA.UsePREF64, config_parse_bool, 0, offsetof(Network, ipv6_accept_ra_use_pref64)
|
||||
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.UseMTU, config_parse_bool, 0, offsetof(Network, ipv6_accept_ra_use_mtu)
|
||||
IPv6AcceptRA.UseHopLimit, config_parse_bool, 0, offsetof(Network, ipv6_accept_ra_use_hop_limit)
|
||||
IPv6AcceptRA.UseReachableTime, config_parse_bool, 0, offsetof(Network, ipv6_accept_ra_use_reachable_time)
|
||||
IPv6AcceptRA.UseRetransmissionTime, config_parse_bool, 0, offsetof(Network, ipv6_accept_ra_use_retransmission_time)
|
||||
IPv6AcceptRA.UseICMP6RateLimit, config_parse_bool, 0, offsetof(Network, ipv6_accept_ra_use_icmp6_ratelimit)
|
||||
IPv6AcceptRA.DHCPv6Client, config_parse_ipv6_accept_ra_start_dhcp6_client, 0, offsetof(Network, ipv6_accept_ra_start_dhcp6_client)
|
||||
IPv6AcceptRA.UseGateway, config_parse_bool, 0, offsetof(Network, ndisc_use_gateway)
|
||||
IPv6AcceptRA.UseRoutePrefix, config_parse_bool, 0, offsetof(Network, ndisc_use_route_prefix)
|
||||
IPv6AcceptRA.UseAutonomousPrefix, config_parse_bool, 0, offsetof(Network, ndisc_use_autonomous_prefix)
|
||||
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_bool, 0, offsetof(Network, ndisc_use_dns)
|
||||
IPv6AcceptRA.UseDomains, config_parse_ndisc_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)
|
||||
IPv6AcceptRA.UseReachableTime, config_parse_bool, 0, offsetof(Network, ndisc_use_reachable_time)
|
||||
IPv6AcceptRA.UseRetransmissionTime, config_parse_bool, 0, offsetof(Network, ndisc_use_retransmission_time)
|
||||
IPv6AcceptRA.UseICMP6RateLimit, config_parse_bool, 0, offsetof(Network, ndisc_use_icmp6_ratelimit)
|
||||
IPv6AcceptRA.DHCPv6Client, config_parse_ndisc_start_dhcp6_client, 0, offsetof(Network, ndisc_start_dhcp6_client)
|
||||
IPv6AcceptRA.RouteTable, config_parse_dhcp_or_ra_route_table, AF_INET6, 0
|
||||
IPv6AcceptRA.RouteMetric, config_parse_ipv6_accept_ra_route_metric, 0, 0
|
||||
IPv6AcceptRA.QuickAck, config_parse_bool, 0, offsetof(Network, ipv6_accept_ra_quickack)
|
||||
IPv6AcceptRA.UseCaptivePortal, config_parse_bool, 0, offsetof(Network, ipv6_accept_ra_use_captive_portal)
|
||||
IPv6AcceptRA.RouteMetric, config_parse_ndisc_route_metric, 0, 0
|
||||
IPv6AcceptRA.QuickAck, config_parse_bool, 0, offsetof(Network, ndisc_quickack)
|
||||
IPv6AcceptRA.UseCaptivePortal, config_parse_bool, 0, offsetof(Network, ndisc_use_captive_portal)
|
||||
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)
|
||||
IPv6AcceptRA.PrefixAllowList, config_parse_in_addr_prefixes, AF_INET6, offsetof(Network, ndisc_allow_listed_prefix)
|
||||
@@ -611,7 +611,7 @@ DHCP.RapidCommit, config_parse_bool,
|
||||
DHCP.ForceDHCPv6PDOtherInformation, config_parse_warn_compat, DISABLED_LEGACY, 0
|
||||
DHCPv4.UseDomainName, config_parse_dhcp_use_domains, AF_INET, 0
|
||||
DHCPv4.CriticalConnection, config_parse_tristate, 0, offsetof(Network, dhcp_critical)
|
||||
DHCPv6.RouteMetric, config_parse_ipv6_accept_ra_route_metric, AF_INET6, 0
|
||||
DHCPv6.RouteMetric, config_parse_ndisc_route_metric, AF_INET6, 0
|
||||
DHCPv6.ForceDHCPv6PDOtherInformation, config_parse_warn_compat, DISABLED_LEGACY, 0
|
||||
DHCPv6PrefixDelegation.SubnetId, config_parse_dhcp_pd_subnet_id, 0, offsetof(Network, dhcp_pd_subnet_id)
|
||||
DHCPv6PrefixDelegation.Announce, config_parse_bool, 0, offsetof(Network, dhcp_pd_announce)
|
||||
|
||||
@@ -226,7 +226,7 @@ int network_verify(Network *network) {
|
||||
network->ipv6ll_address_gen_mode = IPV6_LINK_LOCAL_ADDRESSS_GEN_MODE_STABLE_PRIVACY;
|
||||
|
||||
network_adjust_ipv6_proxy_ndp(network);
|
||||
network_adjust_ipv6_accept_ra(network);
|
||||
network_adjust_ndisc(network);
|
||||
network_adjust_dhcp(network);
|
||||
network_adjust_radv(network);
|
||||
network_adjust_bridge_vlan(network);
|
||||
@@ -472,23 +472,23 @@ int network_load_one(Manager *manager, OrderedHashmap **networks, const char *fi
|
||||
.proxy_arp_pvlan = -1,
|
||||
.ipv4_rp_filter = _IP_REVERSE_PATH_FILTER_INVALID,
|
||||
|
||||
.ipv6_accept_ra = -1,
|
||||
.ipv6_accept_ra_use_dns = true,
|
||||
.ipv6_accept_ra_use_gateway = true,
|
||||
.ipv6_accept_ra_use_captive_portal = true,
|
||||
.ipv6_accept_ra_use_route_prefix = true,
|
||||
.ipv6_accept_ra_use_autonomous_prefix = true,
|
||||
.ipv6_accept_ra_use_onlink_prefix = true,
|
||||
.ipv6_accept_ra_use_mtu = true,
|
||||
.ipv6_accept_ra_use_hop_limit = true,
|
||||
.ipv6_accept_ra_use_reachable_time = true,
|
||||
.ipv6_accept_ra_use_retransmission_time = true,
|
||||
.ipv6_accept_ra_use_icmp6_ratelimit = true,
|
||||
.ipv6_accept_ra_route_table = RT_TABLE_MAIN,
|
||||
.ipv6_accept_ra_route_metric_high = IPV6RA_ROUTE_METRIC_HIGH,
|
||||
.ipv6_accept_ra_route_metric_medium = IPV6RA_ROUTE_METRIC_MEDIUM,
|
||||
.ipv6_accept_ra_route_metric_low = IPV6RA_ROUTE_METRIC_LOW,
|
||||
.ipv6_accept_ra_start_dhcp6_client = IPV6_ACCEPT_RA_START_DHCP6_CLIENT_YES,
|
||||
.ndisc = -1,
|
||||
.ndisc_use_dns = true,
|
||||
.ndisc_use_gateway = true,
|
||||
.ndisc_use_captive_portal = true,
|
||||
.ndisc_use_route_prefix = true,
|
||||
.ndisc_use_autonomous_prefix = true,
|
||||
.ndisc_use_onlink_prefix = true,
|
||||
.ndisc_use_mtu = true,
|
||||
.ndisc_use_hop_limit = true,
|
||||
.ndisc_use_reachable_time = true,
|
||||
.ndisc_use_retransmission_time = true,
|
||||
.ndisc_use_icmp6_ratelimit = true,
|
||||
.ndisc_route_table = RT_TABLE_MAIN,
|
||||
.ndisc_route_metric_high = IPV6RA_ROUTE_METRIC_HIGH,
|
||||
.ndisc_route_metric_medium = IPV6RA_ROUTE_METRIC_MEDIUM,
|
||||
.ndisc_route_metric_low = IPV6RA_ROUTE_METRIC_LOW,
|
||||
.ndisc_start_dhcp6_client = IPV6_ACCEPT_RA_START_DHCP6_CLIENT_YES,
|
||||
|
||||
.can_termination = -1,
|
||||
|
||||
|
||||
@@ -334,31 +334,31 @@ struct Network {
|
||||
int ipv6_proxy_ndp;
|
||||
Set *ipv6_proxy_ndp_addresses;
|
||||
|
||||
/* IPv6 accept RA */
|
||||
int ipv6_accept_ra;
|
||||
bool ipv6_accept_ra_use_dns;
|
||||
bool ipv6_accept_ra_use_gateway;
|
||||
bool ipv6_accept_ra_use_route_prefix;
|
||||
bool ipv6_accept_ra_use_autonomous_prefix;
|
||||
bool ipv6_accept_ra_use_onlink_prefix;
|
||||
bool ipv6_accept_ra_use_mtu;
|
||||
bool ipv6_accept_ra_use_hop_limit;
|
||||
bool ipv6_accept_ra_use_reachable_time;
|
||||
bool ipv6_accept_ra_use_retransmission_time;
|
||||
bool ipv6_accept_ra_use_icmp6_ratelimit;
|
||||
bool ipv6_accept_ra_quickack;
|
||||
bool ipv6_accept_ra_use_captive_portal;
|
||||
bool ipv6_accept_ra_use_pref64;
|
||||
/* NDisc support */
|
||||
int ndisc;
|
||||
bool ndisc_use_dns;
|
||||
bool ndisc_use_gateway;
|
||||
bool ndisc_use_route_prefix;
|
||||
bool ndisc_use_autonomous_prefix;
|
||||
bool ndisc_use_onlink_prefix;
|
||||
bool ndisc_use_mtu;
|
||||
bool ndisc_use_hop_limit;
|
||||
bool ndisc_use_reachable_time;
|
||||
bool ndisc_use_retransmission_time;
|
||||
bool ndisc_use_icmp6_ratelimit;
|
||||
bool ndisc_quickack;
|
||||
bool ndisc_use_captive_portal;
|
||||
bool ndisc_use_pref64;
|
||||
bool active_slave;
|
||||
bool primary_slave;
|
||||
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_high;
|
||||
uint32_t ipv6_accept_ra_route_metric_medium;
|
||||
uint32_t ipv6_accept_ra_route_metric_low;
|
||||
bool ipv6_accept_ra_route_metric_set;
|
||||
DHCPUseDomains ndisc_use_domains;
|
||||
IPv6AcceptRAStartDHCP6Client ndisc_start_dhcp6_client;
|
||||
uint32_t ndisc_route_table;
|
||||
bool ndisc_route_table_set;
|
||||
uint32_t ndisc_route_metric_high;
|
||||
uint32_t ndisc_route_metric_medium;
|
||||
uint32_t ndisc_route_metric_low;
|
||||
bool ndisc_route_metric_set;
|
||||
Set *ndisc_deny_listed_router;
|
||||
Set *ndisc_allow_listed_router;
|
||||
Set *ndisc_deny_listed_prefix;
|
||||
|
||||
@@ -840,7 +840,7 @@ int route_section_verify_nexthops(Route *route) {
|
||||
"Ignoring [Route] section from line %u.",
|
||||
route->section->filename, route->section->line);
|
||||
|
||||
if (route->nexthop.family == AF_INET6 && route->network->ipv6_accept_ra == 0)
|
||||
if (route->nexthop.family == AF_INET6 && route->network->ndisc == 0)
|
||||
return log_warning_errno(SYNTHETIC_ERRNO(EINVAL),
|
||||
"%s: Gateway=\"_ipv6ra\" is specified but IPv6AcceptRA= is disabled. "
|
||||
"Ignoring [Route] section from line %u.",
|
||||
|
||||
@@ -123,7 +123,7 @@ static int link_put_dns(Link *link, OrderedSet **s) {
|
||||
}
|
||||
}
|
||||
|
||||
if (link->network->ipv6_accept_ra_use_dns) {
|
||||
if (link->network->ndisc_use_dns) {
|
||||
NDiscRDNSS *a;
|
||||
|
||||
SET_FOREACH(a, link->ndisc_rdnss) {
|
||||
@@ -254,7 +254,7 @@ static int link_put_domains(Link *link, bool is_route, OrderedSet **s) {
|
||||
}
|
||||
}
|
||||
|
||||
if (link->network->ipv6_accept_ra_use_domains == use_domains) {
|
||||
if (link->network->ndisc_use_domains == use_domains) {
|
||||
NDiscDNSSL *a;
|
||||
|
||||
SET_FOREACH(a, link->ndisc_dnssl) {
|
||||
@@ -559,7 +559,7 @@ static void link_save_domains(Link *link, FILE *f, OrderedSet *static_domains, D
|
||||
fputstrv(f, domains, NULL, &space);
|
||||
}
|
||||
|
||||
if (link->network->ipv6_accept_ra_use_domains == use_domains) {
|
||||
if (link->network->ndisc_use_domains == use_domains) {
|
||||
NDiscDNSSL *dd;
|
||||
|
||||
SET_FOREACH(dd, link->ndisc_dnssl)
|
||||
@@ -675,7 +675,7 @@ static int link_save(Link *link) {
|
||||
sd_dhcp6_lease_get_dns,
|
||||
NULL);
|
||||
|
||||
if (link->network->ipv6_accept_ra_use_dns) {
|
||||
if (link->network->ndisc_use_dns) {
|
||||
NDiscRDNSS *dd;
|
||||
|
||||
SET_FOREACH(dd, link->ndisc_rdnss)
|
||||
|
||||
Reference in New Issue
Block a user