From c6ffb8789cdd66307b062b90273a87154ed6cc8d Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Sat, 20 Apr 2024 14:36:40 +0900 Subject: [PATCH] network/radv: warn about non-zero preference with zero lifetime Note that the misconfiguration will be handled gracefully. So it is not necessary to adjust value here. Let's only warn about that. --- src/network/networkd-radv.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/network/networkd-radv.c b/src/network/networkd-radv.c index 01e1a0102a4..9ca20e1d51b 100644 --- a/src/network/networkd-radv.c +++ b/src/network/networkd-radv.c @@ -859,6 +859,15 @@ void network_adjust_radv(Network *network) { /* Below, let's verify router settings, if enabled. */ + if (network->router_lifetime_usec == 0 && network->router_preference != SD_NDISC_PREFERENCE_MEDIUM) + /* RFC 4191, Section 2.2, + * If the Router Lifetime is zero, the preference value MUST be set to (00) by the sender. + * + * Note, radv_send_router() gracefully handle that. So, it is not necessary to refuse, but + * let's warn about that. */ + log_notice("%s: RouterPreference=%s specified with RouterLifetimeSec=0, ignoring RouterPreference= setting.", + network->filename, ndisc_router_preference_to_string(network->router_preference)); + Prefix *prefix; HASHMAP_FOREACH(prefix, network->prefixes_by_section) if (prefix_section_verify(prefix) < 0) -- 2.47.3