summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSusant Sahani <ssahani@users.noreply.github.com>2016-06-13 19:27:17 +0530
committerLennart Poettering <lennart@poettering.net>2016-06-13 15:57:17 +0200
commit1c4b11794bdf54480a69a55645e60d5996dcb454 (patch)
treee6d642e810cb560d0080b37365a785dbd64b69b1
parent2065ca699b38d97b2a4ebd34a7c2d2c186970d20 (diff)
networkd: route priority replace parsing config_parse_uint32 with safe_atou32 (#3522)
-rw-r--r--src/network/networkd-route.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/network/networkd-route.c b/src/network/networkd-route.c
index 52037f9c6d..cedaf47cf8 100644
--- a/src/network/networkd-route.c
+++ b/src/network/networkd-route.c
@@ -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;