aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2013-08-23 14:45:42 +0200
committerNatanael Copa <ncopa@alpinelinux.org>2013-08-23 14:45:42 +0200
commit1f101a5ffe7def8c1fcdf26c8d4e68a620104730 (patch)
tree200e3c719b595e5d3d8699f0ffecb112b8000775
parent6afdbefa7066713abb814de258dfaeed08964d92 (diff)
downloadpingu-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.c6
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) {