networkd: route priority replace parsing config_parse_uint32 with safe_atou32 (#3522)
This commit is contained in:
parent
2065ca699b
commit
1c4b11794b
|
@ -795,6 +795,7 @@ int config_parse_route_priority(const char *unit,
|
||||||
void *userdata) {
|
void *userdata) {
|
||||||
Network *network = userdata;
|
Network *network = userdata;
|
||||||
_cleanup_route_free_ Route *n = NULL;
|
_cleanup_route_free_ Route *n = NULL;
|
||||||
|
uint32_t k;
|
||||||
int r;
|
int r;
|
||||||
|
|
||||||
assert(filename);
|
assert(filename);
|
||||||
|
@ -807,12 +808,14 @@ int config_parse_route_priority(const char *unit,
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
return r;
|
return r;
|
||||||
|
|
||||||
r = config_parse_uint32(unit, filename, line, section,
|
r = safe_atou32(rvalue, &k);
|
||||||
section_line, lvalue, ltype,
|
if (r < 0) {
|
||||||
rvalue, &n->priority, userdata);
|
log_syntax(unit, LOG_ERR, filename, line, r,
|
||||||
if (r < 0)
|
"Could not parse route priority \"%s\", ignoring assignment: %m", rvalue);
|
||||||
return r;
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
n->priority = k;
|
||||||
n = NULL;
|
n = NULL;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in a new issue