]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
networkd: route priority replace parsing config_parse_uint32 with safe_atou32 (#3522)
authorSusant Sahani <ssahani@users.noreply.github.com>
Mon, 13 Jun 2016 13:57:17 +0000 (19:27 +0530)
committerLennart Poettering <lennart@poettering.net>
Mon, 13 Jun 2016 13:57:17 +0000 (15:57 +0200)
src/network/networkd-route.c

index 52037f9c6d1695d54ca2ac747c61c5ced212ad0f..cedaf47cf8e028a0d158b78979f28b1cfb8daede 100644 (file)
@@ -795,6 +795,7 @@ int config_parse_route_priority(const char *unit,
                                 void *userdata) {
         Network *network = userdata;
         _cleanup_route_free_ Route *n = NULL;
+        uint32_t k;
         int r;
 
         assert(filename);
@@ -807,12 +808,14 @@ int config_parse_route_priority(const char *unit,
         if (r < 0)
                 return r;
 
-        r = config_parse_uint32(unit, filename, line, section,
-                                section_line, lvalue, ltype,
-                                rvalue, &n->priority, userdata);
-        if (r < 0)
-                return r;
+        r = safe_atou32(rvalue, &k);
+        if (r < 0) {
+                log_syntax(unit, LOG_ERR, filename, line, r,
+                           "Could not parse route priority \"%s\", ignoring assignment: %m", rvalue);
+                return 0;
+        }
 
+        n->priority = k;
         n = NULL;
 
         return 0;