link_radv_enabled() and link_ndisc_enabled() use link_ipv6ll_enabled_harder(), which considers a static fe80:: address in [Address] sufficient to run radv/ndisc even when LinkLocalAddressing= (or IPv6LinkLocalAddressGenerationMode=none, which network_verify() folds into the same flag) disables the kernel-generated link-local. network_adjust_radv()/ndisc()/dhcp() however only check the raw link_local flag and zero router_prefix_delegation / ndisc / dhcp&IPV6 at parse time, so the runtime gate never gets a chance to fire. Factor the static-LL lookup out of link_ipv6ll_enabled_harder() into a Network-level helper and use it in the three network_adjust_*() functions, bringing parse-time and runtime behaviour in line.
31 lines
1.3 KiB
C
31 lines
1.3 KiB
C
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
|
#pragma once
|
|
|
|
#include <linux/if_link.h>
|
|
|
|
#include "networkd-forward.h"
|
|
|
|
typedef enum IPv6LinkLocalAddressGenMode {
|
|
IPV6_LINK_LOCAL_ADDRESSS_GEN_MODE_EUI64 = IN6_ADDR_GEN_MODE_EUI64,
|
|
IPV6_LINK_LOCAL_ADDRESSS_GEN_MODE_NONE = IN6_ADDR_GEN_MODE_NONE,
|
|
IPV6_LINK_LOCAL_ADDRESSS_GEN_MODE_STABLE_PRIVACY = IN6_ADDR_GEN_MODE_STABLE_PRIVACY,
|
|
IPV6_LINK_LOCAL_ADDRESSS_GEN_MODE_RANDOM = IN6_ADDR_GEN_MODE_RANDOM,
|
|
_IPV6_LINK_LOCAL_ADDRESS_GEN_MODE_MAX,
|
|
_IPV6_LINK_LOCAL_ADDRESS_GEN_MODE_INVALID = -EINVAL,
|
|
} IPv6LinkLocalAddressGenMode;
|
|
|
|
bool link_ipv6ll_enabled(Link *link);
|
|
bool link_ipv6ll_enabled_harder(Link *link);
|
|
bool network_has_static_ipv6ll_address(const Network *network);
|
|
|
|
IPv6LinkLocalAddressGenMode link_get_ipv6ll_addrgen_mode(Link *link);
|
|
int ipv6ll_addrgen_mode_fill_message(sd_netlink_message *message, IPv6LinkLocalAddressGenMode mode);
|
|
int link_update_ipv6ll_addrgen_mode(Link *link, sd_netlink_message *message);
|
|
|
|
int link_set_ipv6ll_stable_secret(Link *link);
|
|
int link_set_ipv6ll_addrgen_mode(Link *link, IPv6LinkLocalAddressGenMode mode);
|
|
|
|
DECLARE_STRING_TABLE_LOOKUP(ipv6_link_local_address_gen_mode, IPv6LinkLocalAddressGenMode);
|
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_ipv6_link_local_address_gen_mode);
|