]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
network/radv: allow to announce prefix and route information with zero lifetime 31997/head
authorYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 28 Mar 2024 04:25:50 +0000 (13:25 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 28 Mar 2024 04:28:58 +0000 (13:28 +0900)
Setting zero lifetime for prefix or route information option is valid,
and is used for announcing the prefix or route is invalidated.

Fixes #26239.

src/network/networkd-radv.c

index 7fd97e7206ffd4ab4168321668eeb909ce8b6791..82c62dad815ef0ef2dfff68c60d47ebf856c9d68 100644 (file)
@@ -816,12 +816,6 @@ static int prefix_section_verify(Prefix *p) {
                 p->assign = false;
         }
 
-        if (p->valid_lifetime == 0)
-                return log_warning_errno(SYNTHETIC_ERRNO(EINVAL),
-                                         "%s: The valid lifetime of prefix cannot be zero. "
-                                         "Ignoring [IPv6Prefix] section from line %u.",
-                                         p->section->filename, p->section->line);
-
         if (p->preferred_lifetime > p->valid_lifetime)
                 return log_warning_errno(SYNTHETIC_ERRNO(EINVAL),
                                          "%s: The preferred lifetime %s is longer than the valid lifetime %s. "
@@ -854,12 +848,6 @@ static int route_prefix_section_verify(RoutePrefix *p) {
                                          "Valid range is 0…128. Ignoring [IPv6RoutePrefix] section from line %u.",
                                          p->section->filename, p->prefixlen, p->section->line);
 
-        if (p->lifetime == 0)
-                return log_warning_errno(SYNTHETIC_ERRNO(EINVAL),
-                                         "%s: The lifetime of route cannot be zero. "
-                                         "Ignoring [IPv6RoutePrefix] section from line %u.",
-                                         p->section->filename, p->section->line);
-
         return 0;
 }