diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2013-08-23 14:45:42 +0200 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2013-08-23 14:45:42 +0200 |
commit | 1f101a5ffe7def8c1fcdf26c8d4e68a620104730 (patch) | |
tree | 200e3c719b595e5d3d8699f0ffecb112b8000775 | |
parent | 6afdbefa7066713abb814de258dfaeed08964d92 (diff) | |
download | pingu-1f101a5ffe7def8c1fcdf26c8d4e68a620104730.tar.bz2 pingu-1f101a5ffe7def8c1fcdf26c8d4e68a620104730.tar.xz |
pingu_conf: error checking for route-table
and support route-table as hexadecimal as a bonus.
-rw-r--r-- | src/pingu_conf.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/pingu_conf.c b/src/pingu_conf.c index 4bdb1bf..24ef229 100644 --- a/src/pingu_conf.c +++ b/src/pingu_conf.c @@ -153,7 +153,11 @@ static int pingu_conf_read_iface(struct pingu_conf *conf, char *ifname) if (key == NULL || key[0] == '}') break; if (strcmp(key, "route-table") == 0) { - pingu_iface_set_route_table(iface, atoi(value)); + int status, n; + status = parse_int(value, &n, conf->lineno); + if (status == 0) + pingu_iface_set_route_table(iface, n); + r += status; } else if (strcmp(key, "label") == 0) { iface->label = xstrdup(value); } else if (strcmp(key, "gateway-up-action") == 0) { |