From 1f101a5ffe7def8c1fcdf26c8d4e68a620104730 Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Fri, 23 Aug 2013 14:45:42 +0200 Subject: pingu_conf: error checking for route-table and support route-table as hexadecimal as a bonus. --- src/pingu_conf.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src') 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) { -- cgit v1.2.3