]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
network: radv: ignore Assign= if prefixlen is larger than 64
authorYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 1 Oct 2021 08:59:56 +0000 (17:59 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 6 Oct 2021 16:09:09 +0000 (01:09 +0900)
src/network/networkd-radv.c

index dabd91c0f9ae52692bd6321a2322496ef47f9cc5..b9ba0ff9baaa49ed1962446851f91e724c0ab62f 100644 (file)
@@ -215,6 +215,17 @@ int link_request_radv_addresses(Link *link) {
                 if (r < 0)
                         return r;
 
+                /* generate_eui64_address() below requires the prefix length <= 64. */
+                if (prefixlen > 64) {
+                        _cleanup_free_ char *str = NULL;
+
+                        (void) in6_addr_prefix_to_string(&prefix, prefixlen, &str);
+                        log_link_debug(link,
+                                       "Prefix is longer than 64, refusing to assign an address in %s.",
+                                       strna(str));
+                        continue;
+                }
+
                 r = address_new(&address);
                 if (r < 0)
                         return log_oom();