summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Graf <tgraf@suug.ch>2011-03-17 15:11:10 (GMT)
committerThomas Graf <tgraf@suug.ch>2011-03-17 15:11:10 (GMT)
commit2c75886060ac145ac76b19d17a144a76ee801382 (patch)
tree8180ef8ffca4fec24a4200a39d07169fe582dec1
parent5a9f50b8e9be45094acbe313b31a81ceaabc6c96 (diff)
downloadlibnl-2c75886060ac145ac76b19d17a144a76ee801382.zip
libnl-2c75886060ac145ac76b19d17a144a76ee801382.tar.gz
libnl-2c75886060ac145ac76b19d17a144a76ee801382.tar.bz2
Fix off-by-one when reading IFLA_INET6_CONF and IFLA_INET6_STATS
-rw-r--r--lib/route/link/inet6.c4
1 files 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]);
}