ndisc-option: also ignore Prefix Information option with multicast address

Fixes https://github.com/systemd/systemd/pull/32215#issuecomment-2049624693
This commit is contained in:
Yu Watanabe 2024-04-12 03:30:01 +09:00 committed by Luca Boccassi
parent dd63f00c64
commit 296afa8477

View file

@ -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)