parse-util: introduce parse_ifindex() and make use of it everywhere
We have enough places where we parse an ifindex, hence introduce a proper parsing function for it, that verifies all parameters.
This commit is contained in:
@@ -332,9 +332,7 @@ int machine_load(Machine *m) {
|
||||
break;
|
||||
}
|
||||
|
||||
if (safe_atoi(word, &ifi) < 0)
|
||||
continue;
|
||||
if (ifi <= 0)
|
||||
if (parse_ifindex(word, &ifi) < 0)
|
||||
continue;
|
||||
|
||||
if (!GREEDY_REALLOC(ni, allocated, nr+1)) {
|
||||
|
||||
Reference in New Issue
Block a user