From b10d6769d214a681f4114fea83b18f1cbc53c501 Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Fri, 23 Aug 2013 14:54:50 +0200 Subject: pingu_conf: error checking for required-hosts-online and rule-priority and support hexadecimal values --- src/pingu_conf.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/pingu_conf.c b/src/pingu_conf.c index 24ef229..6470809 100644 --- a/src/pingu_conf.c +++ b/src/pingu_conf.c @@ -165,9 +165,11 @@ static int pingu_conf_read_iface(struct pingu_conf *conf, char *ifname) } else if (strcmp(key, "gateway-down-action") == 0) { iface->gw_down_action = xstrdup(value); } else if (strcmp(key, "required-hosts-online") == 0) { - iface->required_hosts_online = atoi(value); + r += parse_int(value, &iface->required_hosts_online, + conf->lineno); } else if (strcmp(key, "rule-priority") == 0) { - iface->rule_priority = atoi(value); + r += parse_int(value, &iface->rule_priority, + conf->lineno); } else if (strcmp(key, "load-balance") == 0) { int weight = 0; if (value != NULL) { -- cgit v1.2.3