diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2024-04-11 20:30:01 +0200 |
---|---|---|
committer | Luca Boccassi <luca.boccassi@gmail.com> | 2024-04-12 11:34:12 +0200 |
commit | 296afa847704a61177b2ceea4dae4f2148cc27d0 (patch) | |
tree | 00d59c4d82ee0f0aa7828c98f8b8d6381ac8323d /src/libsystemd-network/ndisc-option.c | |
parent | Merge pull request #32240 from yuwata/network-ndisc-fix-on-link-prefix (diff) | |
download | systemd-296afa847704a61177b2ceea4dae4f2148cc27d0.tar.xz systemd-296afa847704a61177b2ceea4dae4f2148cc27d0.zip |
ndisc-option: also ignore Prefix Information option with multicast address
Fixes https://github.com/systemd/systemd/pull/32215#issuecomment-2049624693
Diffstat (limited to 'src/libsystemd-network/ndisc-option.c')
-rw-r--r-- | src/libsystemd-network/ndisc-option.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/libsystemd-network/ndisc-option.c b/src/libsystemd-network/ndisc-option.c index 447b14d15b..96c357ced4 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) |