From 2c75886060ac145ac76b19d17a144a76ee801382 Mon Sep 17 00:00:00 2001 From: Thomas Graf Date: Thu, 17 Mar 2011 16:11:10 +0100 Subject: Fix off-by-one when reading IFLA_INET6_CONF and IFLA_INET6_STATS --- lib/route/link/inet6.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/route/link/inet6.c b/lib/route/link/inet6.c index cfb0e44..399dd4b 100644 --- a/lib/route/link/inet6.c +++ b/lib/route/link/inet6.c @@ -76,7 +76,7 @@ static int inet6_parse_protinfo(struct rtnl_link *link, struct nlattr *attr, uint64_t *cnt = nla_data(tb[IFLA_INET6_STATS]); int i; - for (i = 1; i <= __IPSTATS_MIB_MAX; i++) + for (i = 1; i < __IPSTATS_MIB_MAX; i++) rtnl_link_set_stat(link, RTNL_LINK_IP6_INPKTS + i - 1, cnt[i]); } @@ -85,7 +85,7 @@ static int inet6_parse_protinfo(struct rtnl_link *link, struct nlattr *attr, uint64_t *cnt = nla_data(tb[IFLA_INET6_ICMP6STATS]); int i; - for (i = 1; i <= __ICMP6_MIB_MAX; i++) + for (i = 1; i < __ICMP6_MIB_MAX; i++) rtnl_link_set_stat(link, RTNL_LINK_ICMP6_INMSGS + i - 1, cnt[i]); } -- cgit v0.12