From: Yu Watanabe Date: Thu, 11 Apr 2024 18:30:01 +0000 (+0900) Subject: ndisc-option: also ignore Prefix Information option with multicast address X-Git-Tag: v256-rc1~215 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=296afa847704a61177b2ceea4dae4f2148cc27d0;p=thirdparty%2Fsystemd.git ndisc-option: also ignore Prefix Information option with multicast address Fixes https://github.com/systemd/systemd/pull/32215#issuecomment-2049624693 --- diff --git a/src/libsystemd-network/ndisc-option.c b/src/libsystemd-network/ndisc-option.c index 447b14d15b1..96c357ced4c 100644 --- a/src/libsystemd-network/ndisc-option.c +++ b/src/libsystemd-network/ndisc-option.c @@ -350,7 +350,9 @@ int ndisc_option_add_prefix_internal( struct in6_addr addr = *address; in6_addr_mask(&addr, prefixlen); - if (in6_addr_is_link_local(&addr) || in6_addr_is_null(&addr)) + /* RFC 4861 and 4862 only state that link-local prefix should be ignored. + * But here we also ignore null and multicast addresses. */ + if (in6_addr_is_link_local(&addr) || in6_addr_is_null(&addr) || in6_addr_is_multicast(&addr)) return -EINVAL; if (preferred_lifetime > valid_lifetime)