From: Yu Watanabe Date: Sat, 20 Apr 2024 05:36:40 +0000 (+0900) Subject: network/radv: warn about non-zero preference with zero lifetime X-Git-Tag: v256-rc1~54^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c6ffb8789cdd66307b062b90273a87154ed6cc8d;p=thirdparty%2Fsystemd.git 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. --- 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)