]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
network: allow empty assignment to PreferredLifetime= 15872/head
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 21 May 2020 06:36:01 +0000 (08:36 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 25 May 2020 12:52:04 +0000 (14:52 +0200)
Users might want to use that to unset a previous setting. The docs seem OK as
they are: we don't need to explictly mention the empty value, since it is
almost always allowed.

src/network/networkd-address.c

index f9bbd05dd8ba81e7f622fb4d42ac851e7e8f7bc7..9b78530334a08f0cb2adececb5d98f962badd5fe 100644 (file)
@@ -967,8 +967,8 @@ int config_parse_lifetime(const char *unit,
         if (r < 0)
                 return r;
 
-        /* We accept only "forever", "infinity", or "0". */
-        if (STR_IN_SET(rvalue, "forever", "infinity"))
+        /* We accept only "forever", "infinity", empty, or "0". */
+        if (STR_IN_SET(rvalue, "forever", "infinity", ""))
                 k = CACHE_INFO_INFINITY_LIFE_TIME;
         else if (streq(rvalue, "0"))
                 k = 0;