]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
ndisc-option: also ignore Prefix Information option with multicast address
authorYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 11 Apr 2024 18:30:01 +0000 (03:30 +0900)
committerLuca Boccassi <luca.boccassi@gmail.com>
Fri, 12 Apr 2024 09:34:12 +0000 (10:34 +0100)
Fixes https://github.com/systemd/systemd/pull/32215#issuecomment-2049624693

src/libsystemd-network/ndisc-option.c

index 447b14d15b10946438c1f533fd6547ac7f0b3a72..96c357ced4c14d908a096e27444af499642604cf 100644 (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)