From 44013aa4f57c1a5ac7766a3a7cd719d912deb245 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Tue, 27 Aug 2019 23:45:00 +0900 Subject: [PATCH] network: add more warnings in network_verify() --- src/network/networkd-network.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/network/networkd-network.c b/src/network/networkd-network.c index 91326ce..2b8d0eb 100644 --- a/src/network/networkd-network.c +++ b/src/network/networkd-network.c @@ -220,6 +220,26 @@ int network_verify(Network *network) { if (network->link_local < 0) network->link_local = network->bridge ? ADDRESS_FAMILY_NO : ADDRESS_FAMILY_IPV6; + if (!FLAGS_SET(network->link_local, ADDRESS_FAMILY_IPV6)) { + if (network->ipv6_accept_ra > 0) { + log_warning("%s: IPv6AcceptRA= is enabled by the .network file but IPv6 link local addressing is disabled. " + "Disabling IPv6AcceptRA=.", network->filename); + network->ipv6_accept_ra = false; + } + + if (FLAGS_SET(network->dhcp, ADDRESS_FAMILY_IPV6)) { + log_warning("%s: DHCPv6 client is enabled by the .network file but IPv6 link local addressing is disabled. " + "Disabling DHCPv6 client.", network->filename); + SET_FLAG(network->dhcp, ADDRESS_FAMILY_IPV6, false); + } + + if (network->router_prefix_delegation != RADV_PREFIX_DELEGATION_NONE) { + log_warning("%s: IPv6PrefixDelegation= is enabled but IPv6 link local addressing is disabled. " + "Disabling IPv6PrefixDelegation=.", network->filename); + network->router_prefix_delegation = RADV_PREFIX_DELEGATION_NONE; + } + } + if (FLAGS_SET(network->link_local, ADDRESS_FAMILY_FALLBACK_IPV4) && !FLAGS_SET(network->dhcp, ADDRESS_FAMILY_IPV4)) { log_warning("%s: fallback assignment of IPv4 link local address is enabled but DHCPv4 is disabled. " -- 2.7.4