network: allow empty assignment to PreferredLifetime=

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.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2020-05-21 08:36:01 +02:00
parent d273579667
commit 10b20e5a93
1 changed files with 2 additions and 2 deletions

View 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;