ipv6: fix array index in ip6_mc_add_src()
Subsystems (3)
PATCH v2 1/1 ipv6: fix array index in ip6_mc_add_src()
From: RongQing.Li <[email protected]>
Convert array index from the loop bound to the loop index.
And remove the void type conversion to ip6_mc_del1_src() return code, seem it is unnecessary, since ip6_mc_del1_src() does not use __must_check similar attribute, no compiler will report the warning when it is removed.
v2: enrich the commit header
--- net/ipv6/mcast.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
net/ipv6/mcast.c +1 -1
@@ -2044,7 +2044,7 @@ static int ip6_mc_add_src(struct inet6_dev *idev, const struct in6_addr *pmca,if (!delta) pmc->mca_sfcount[sfmode]--;for (j=0 ; j<i; j++) - (void )ip6_mc_del1_src (pmc, sfmode, &psfsrc[i]); +ip6_mc_del1_src (pmc, sfmode, &psfsrc[j]); }else if (isexclude != (pmc->mca_sfcount[MCAST_EXCLUDE ] !=0 )) {struct ip6_sf_list *psf;
Signature · 1 line
1.7.1
David Miller
maintainerFrom: [email protected]
Date: Thu, 5 Apr 2012 10:47:04 +0800
Quoted 4 lines
From: RongQing.Li <[email protected]>
Convert array index from the loop bound to the loop index.
Quoted 8 lines
And remove the void type conversion to
ip6_mc_del1_src()return code, seem it is unnecessary, sinceip6_mc_del1_src()does not use__must_checksimilar attribute, no compiler will report the warning when it is removed.v2: enrich the commit header
Signed-off-by RongQing.Li <[email protected]>
Applied and queued up for -stable, thank you.