From b25ea4d085c858137ec28b1be9d6ab6c30a97303 Mon Sep 17 00:00:00 2001 From: Paul Jakma Date: Mon, 11 Sep 2006 02:14:16 +0000 Subject: [ripd] bug #293: routemap set metric doesn't check for underflow correctly 2006-09-11 Paul Jakma * rip_routemap.c: (route_set_metric) underflow check needs to use signed, problem identified and diagnosed by Pavel Nikiforov in bug #293. --- ripd/rip_routemap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ripd/rip_routemap.c') diff --git a/ripd/rip_routemap.c b/ripd/rip_routemap.c index 9d6fd16e..cb87ea55 100644 --- a/ripd/rip_routemap.c +++ b/ripd/rip_routemap.c @@ -530,7 +530,7 @@ route_set_metric (void *rule, struct prefix *prefix, else if (mod->type == metric_absolute) rinfo->metric_out = mod->metric; - if (rinfo->metric_out < 1) + if ((signed int)rinfo->metric_out < 1) rinfo->metric_out = 1; if (rinfo->metric_out > RIP_METRIC_INFINITY) rinfo->metric_out = RIP_METRIC_INFINITY; -- cgit v1.2.1