From 75d5abd29876c31e8ea3a30bb397d2cbd3cfbbb6 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Sat, 22 May 2021 08:15:00 +0900 Subject: [PATCH] network: IPv6LinkLocalAddressGenerationMode=none disables IPv6LL addressing --- man/systemd.network.xml | 14 +++++++++----- src/network/networkd-network.c | 2 ++ 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/man/systemd.network.xml b/man/systemd.network.xml index 61acea1a8b5..e267d4d40c6 100644 --- a/man/systemd.network.xml +++ b/man/systemd.network.xml @@ -422,11 +422,15 @@ IPv6LinkLocalAddressGenerationMode= - Specifies how IPv6 link local address is generated. Takes one of eui64, - none, stable-privacy and random. - When unset, the kernel's default will be used. Note that if LinkLocalAddressing= - not configured as ipv6 then IPv6LinkLocalAddressGenerationMode= - is ignored. + Specifies how IPv6 link local address is generated. Takes one of + eui64, none, stable-privacy and + random. When unset, the kernel's default will be used. Note that if + LinkLocalAddressing= is no or + ipv4, then IPv6LinkLocalAddressGenerationMode= will + be ignored. Also, even if LinkLocalAddressing= is yes + or ipv6, setting + IPv6LinkLocalAddressGenerationMode=none disables to configure an IPv6 + link-local address. diff --git a/src/network/networkd-network.c b/src/network/networkd-network.c index bf2c0e99d43..0fa505bcbb3 100644 --- a/src/network/networkd-network.c +++ b/src/network/networkd-network.c @@ -170,6 +170,8 @@ int network_verify(Network *network) { if (network->link_local < 0) network->link_local = network->bridge ? ADDRESS_FAMILY_NO : ADDRESS_FAMILY_IPV6; + if (network->ipv6ll_address_gen_mode == IPV6_LINK_LOCAL_ADDRESSS_GEN_MODE_NONE) + SET_FLAG(network->link_local, ADDRESS_FAMILY_IPV6, false); /* IPMasquerade implies IPForward */ network->ip_forward |= network->ip_masquerade; -- 2.47.3