]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
network/address: make Label= accept an empty string
authorYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 31 Jul 2023 09:04:14 +0000 (18:04 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 31 Jul 2023 09:15:26 +0000 (18:15 +0900)
We usually reset setting when an emptry string is specified.

src/network/networkd-address.c

index 09615a4ce49570a13e0d181b5e63205ce7bda077..a7772a589557914e27bd8ed23f0af802fba19ff0 100644 (file)
@@ -1895,6 +1895,12 @@ int config_parse_label(
                 return 0;
         }
 
+        if (isempty(rvalue)) {
+                n->label = mfree(n->label);
+                TAKE_PTR(n);
+                return 0;
+        }
+
         if (!address_label_valid(rvalue)) {
                 log_syntax(unit, LOG_WARNING, filename, line, 0,
                            "Interface label is too long or invalid, ignoring assignment: %s", rvalue);