networkd: use address_label_valid for label validation
authorSusant Sahani <susant@redhat.com>
Tue, 28 Feb 2017 11:24:33 +0000 (16:54 +0530)
committerSusant Sahani <susant@redhat.com>
Tue, 28 Feb 2017 11:24:33 +0000 (16:54 +0530)
src/network/networkd-address.c

index e34793e..2e6c763 100644 (file)
@@ -821,8 +821,8 @@ int config_parse_label(
         if (r < 0)
                 return r;
 
-        if (strlen(rvalue) >= IFNAMSIZ) {
-                log_syntax(unit, LOG_ERR, filename, line, 0, "Interface label is too long, ignoring assignment: %s", rvalue);
+        if (!address_label_valid(rvalue)) {
+                log_syntax(unit, LOG_ERR, filename, line, 0, "Interface label is too long or invalid, ignoring assignment: %s", rvalue);
                 return 0;
         }