aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/mcast.c
diff options
context:
space:
mode:
authorIan Morris <ipm@chirality.org.uk>2014-08-24 16:53:10 -0400
committerDavid S. Miller <davem@davemloft.net>2014-08-25 01:37:52 -0400
commit67ba4152e8b77eada6a9c64e3c2c84d6112794fc (patch)
tree833bd7925ed3b69ef65f759c3f806cdaa8643d00 /net/ipv6/mcast.c
parenta9b0b2faa8ed299ca617a317e2abb9ea1bf0e733 (diff)
ipv6: White-space cleansing : Line Layouts
This patch makes no changes to the logic of the code but simply addresses coding style issues as detected by checkpatch. Both objdump and diff -w show no differences. A number of items are addressed in this patch: * Multiple spaces converted to tabs * Spaces before tabs removed. * Spaces in pointer typing cleansed (char *)foo etc. * Remove space after sizeof * Ensure spacing around comparators such as if statements. Signed-off-by: Ian Morris <ipm@chirality.org.uk> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/mcast.c')
-rw-r--r--net/ipv6/mcast.c100
1 files changed, 50 insertions, 50 deletions
diff --git a/net/ipv6/mcast.c b/net/ipv6/mcast.c
index 617f0958e164..70881795da96 100644
--- a/net/ipv6/mcast.c
+++ b/net/ipv6/mcast.c
@@ -232,7 +232,7 @@ int ipv6_sock_mc_drop(struct sock *sk, int ifindex, const struct in6_addr *addr)
232 spin_lock(&ipv6_sk_mc_lock); 232 spin_lock(&ipv6_sk_mc_lock);
233 for (lnk = &np->ipv6_mc_list; 233 for (lnk = &np->ipv6_mc_list;
234 (mc_lst = rcu_dereference_protected(*lnk, 234 (mc_lst = rcu_dereference_protected(*lnk,
235 lockdep_is_held(&ipv6_sk_mc_lock))) !=NULL ; 235 lockdep_is_held(&ipv6_sk_mc_lock))) != NULL;
236 lnk = &mc_lst->next) { 236 lnk = &mc_lst->next) {
237 if ((ifindex == 0 || mc_lst->ifindex == ifindex) && 237 if ((ifindex == 0 || mc_lst->ifindex == ifindex) &&
238 ipv6_addr_equal(&mc_lst->addr, addr)) { 238 ipv6_addr_equal(&mc_lst->addr, addr)) {
@@ -390,7 +390,7 @@ int ip6_mc_source(int add, int omode, struct sock *sk,
390 if (!psl) 390 if (!psl)
391 goto done; /* err = -EADDRNOTAVAIL */ 391 goto done; /* err = -EADDRNOTAVAIL */
392 rv = !0; 392 rv = !0;
393 for (i=0; i<psl->sl_count; i++) { 393 for (i = 0; i < psl->sl_count; i++) {
394 rv = !ipv6_addr_equal(&psl->sl_addr[i], source); 394 rv = !ipv6_addr_equal(&psl->sl_addr[i], source);
395 if (rv == 0) 395 if (rv == 0)
396 break; 396 break;
@@ -407,7 +407,7 @@ int ip6_mc_source(int add, int omode, struct sock *sk,
407 /* update the interface filter */ 407 /* update the interface filter */
408 ip6_mc_del_src(idev, group, omode, 1, source, 1); 408 ip6_mc_del_src(idev, group, omode, 1, source, 1);
409 409
410 for (j=i+1; j<psl->sl_count; j++) 410 for (j = i+1; j < psl->sl_count; j++)
411 psl->sl_addr[j-1] = psl->sl_addr[j]; 411 psl->sl_addr[j-1] = psl->sl_addr[j];
412 psl->sl_count--; 412 psl->sl_count--;
413 err = 0; 413 err = 0;
@@ -433,19 +433,19 @@ int ip6_mc_source(int add, int omode, struct sock *sk,
433 newpsl->sl_max = count; 433 newpsl->sl_max = count;
434 newpsl->sl_count = count - IP6_SFBLOCK; 434 newpsl->sl_count = count - IP6_SFBLOCK;
435 if (psl) { 435 if (psl) {
436 for (i=0; i<psl->sl_count; i++) 436 for (i = 0; i < psl->sl_count; i++)
437 newpsl->sl_addr[i] = psl->sl_addr[i]; 437 newpsl->sl_addr[i] = psl->sl_addr[i];
438 sock_kfree_s(sk, psl, IP6_SFLSIZE(psl->sl_max)); 438 sock_kfree_s(sk, psl, IP6_SFLSIZE(psl->sl_max));
439 } 439 }
440 pmc->sflist = psl = newpsl; 440 pmc->sflist = psl = newpsl;
441 } 441 }
442 rv = 1; /* > 0 for insert logic below if sl_count is 0 */ 442 rv = 1; /* > 0 for insert logic below if sl_count is 0 */
443 for (i=0; i<psl->sl_count; i++) { 443 for (i = 0; i < psl->sl_count; i++) {
444 rv = !ipv6_addr_equal(&psl->sl_addr[i], source); 444 rv = !ipv6_addr_equal(&psl->sl_addr[i], source);
445 if (rv == 0) /* There is an error in the address. */ 445 if (rv == 0) /* There is an error in the address. */
446 goto done; 446 goto done;
447 } 447 }
448 for (j=psl->sl_count-1; j>=i; j--) 448 for (j = psl->sl_count-1; j >= i; j--)
449 psl->sl_addr[j+1] = psl->sl_addr[j]; 449 psl->sl_addr[j+1] = psl->sl_addr[j];
450 psl->sl_addr[i] = *source; 450 psl->sl_addr[i] = *source;
451 psl->sl_count++; 451 psl->sl_count++;
@@ -514,7 +514,7 @@ int ip6_mc_msfilter(struct sock *sk, struct group_filter *gsf)
514 goto done; 514 goto done;
515 } 515 }
516 newpsl->sl_max = newpsl->sl_count = gsf->gf_numsrc; 516 newpsl->sl_max = newpsl->sl_count = gsf->gf_numsrc;
517 for (i=0; i<newpsl->sl_count; ++i) { 517 for (i = 0; i < newpsl->sl_count; ++i) {
518 struct sockaddr_in6 *psin6; 518 struct sockaddr_in6 *psin6;
519 519
520 psin6 = (struct sockaddr_in6 *)&gsf->gf_slist[i]; 520 psin6 = (struct sockaddr_in6 *)&gsf->gf_slist[i];
@@ -606,7 +606,7 @@ int ip6_mc_msfget(struct sock *sk, struct group_filter *gsf,
606 * on ipv6_sk_mc_lock and a write lock on pmc->sflock. We 606 * on ipv6_sk_mc_lock and a write lock on pmc->sflock. We
607 * have the socket lock, so reading here is safe. 607 * have the socket lock, so reading here is safe.
608 */ 608 */
609 for (i=0; i<copycount; i++) { 609 for (i = 0; i < copycount; i++) {
610 struct sockaddr_in6 *psin6; 610 struct sockaddr_in6 *psin6;
611 struct sockaddr_storage ss; 611 struct sockaddr_storage ss;
612 612
@@ -648,7 +648,7 @@ bool inet6_mc_check(struct sock *sk, const struct in6_addr *mc_addr,
648 } else { 648 } else {
649 int i; 649 int i;
650 650
651 for (i=0; i<psl->sl_count; i++) { 651 for (i = 0; i < psl->sl_count; i++) {
652 if (ipv6_addr_equal(&psl->sl_addr[i], src_addr)) 652 if (ipv6_addr_equal(&psl->sl_addr[i], src_addr))
653 break; 653 break;
654 } 654 }
@@ -762,7 +762,7 @@ static void mld_add_delrec(struct inet6_dev *idev, struct ifmcaddr6 *im)
762 pmc->mca_tomb = im->mca_tomb; 762 pmc->mca_tomb = im->mca_tomb;
763 pmc->mca_sources = im->mca_sources; 763 pmc->mca_sources = im->mca_sources;
764 im->mca_tomb = im->mca_sources = NULL; 764 im->mca_tomb = im->mca_sources = NULL;
765 for (psf=pmc->mca_sources; psf; psf=psf->sf_next) 765 for (psf = pmc->mca_sources; psf; psf = psf->sf_next)
766 psf->sf_crcount = pmc->mca_crcount; 766 psf->sf_crcount = pmc->mca_crcount;
767 } 767 }
768 spin_unlock_bh(&im->mca_lock); 768 spin_unlock_bh(&im->mca_lock);
@@ -780,7 +780,7 @@ static void mld_del_delrec(struct inet6_dev *idev, const struct in6_addr *pmca)
780 780
781 spin_lock_bh(&idev->mc_lock); 781 spin_lock_bh(&idev->mc_lock);
782 pmc_prev = NULL; 782 pmc_prev = NULL;
783 for (pmc=idev->mc_tomb; pmc; pmc=pmc->next) { 783 for (pmc = idev->mc_tomb; pmc; pmc = pmc->next) {
784 if (ipv6_addr_equal(&pmc->mca_addr, pmca)) 784 if (ipv6_addr_equal(&pmc->mca_addr, pmca))
785 break; 785 break;
786 pmc_prev = pmc; 786 pmc_prev = pmc;
@@ -794,7 +794,7 @@ static void mld_del_delrec(struct inet6_dev *idev, const struct in6_addr *pmca)
794 spin_unlock_bh(&idev->mc_lock); 794 spin_unlock_bh(&idev->mc_lock);
795 795
796 if (pmc) { 796 if (pmc) {
797 for (psf=pmc->mca_tomb; psf; psf=psf_next) { 797 for (psf = pmc->mca_tomb; psf; psf = psf_next) {
798 psf_next = psf->sf_next; 798 psf_next = psf->sf_next;
799 kfree(psf); 799 kfree(psf);
800 } 800 }
@@ -821,14 +821,14 @@ static void mld_clear_delrec(struct inet6_dev *idev)
821 821
822 /* clear dead sources, too */ 822 /* clear dead sources, too */
823 read_lock_bh(&idev->lock); 823 read_lock_bh(&idev->lock);
824 for (pmc=idev->mc_list; pmc; pmc=pmc->next) { 824 for (pmc = idev->mc_list; pmc; pmc = pmc->next) {
825 struct ip6_sf_list *psf, *psf_next; 825 struct ip6_sf_list *psf, *psf_next;
826 826
827 spin_lock_bh(&pmc->mca_lock); 827 spin_lock_bh(&pmc->mca_lock);
828 psf = pmc->mca_tomb; 828 psf = pmc->mca_tomb;
829 pmc->mca_tomb = NULL; 829 pmc->mca_tomb = NULL;
830 spin_unlock_bh(&pmc->mca_lock); 830 spin_unlock_bh(&pmc->mca_lock);
831 for (; psf; psf=psf_next) { 831 for (; psf; psf = psf_next) {
832 psf_next = psf->sf_next; 832 psf_next = psf->sf_next;
833 kfree(psf); 833 kfree(psf);
834 } 834 }
@@ -917,7 +917,7 @@ int __ipv6_dev_mc_dec(struct inet6_dev *idev, const struct in6_addr *addr)
917 struct ifmcaddr6 *ma, **map; 917 struct ifmcaddr6 *ma, **map;
918 918
919 write_lock_bh(&idev->lock); 919 write_lock_bh(&idev->lock);
920 for (map = &idev->mc_list; (ma=*map) != NULL; map = &ma->next) { 920 for (map = &idev->mc_list; (ma = *map) != NULL; map = &ma->next) {
921 if (ipv6_addr_equal(&ma->mca_addr, addr)) { 921 if (ipv6_addr_equal(&ma->mca_addr, addr)) {
922 if (--ma->mca_users == 0) { 922 if (--ma->mca_users == 0) {
923 *map = ma->next; 923 *map = ma->next;
@@ -968,7 +968,7 @@ bool ipv6_chk_mcast_addr(struct net_device *dev, const struct in6_addr *group,
968 idev = __in6_dev_get(dev); 968 idev = __in6_dev_get(dev);
969 if (idev) { 969 if (idev) {
970 read_lock_bh(&idev->lock); 970 read_lock_bh(&idev->lock);
971 for (mc = idev->mc_list; mc; mc=mc->next) { 971 for (mc = idev->mc_list; mc; mc = mc->next) {
972 if (ipv6_addr_equal(&mc->mca_addr, group)) 972 if (ipv6_addr_equal(&mc->mca_addr, group))
973 break; 973 break;
974 } 974 }
@@ -977,7 +977,7 @@ bool ipv6_chk_mcast_addr(struct net_device *dev, const struct in6_addr *group,
977 struct ip6_sf_list *psf; 977 struct ip6_sf_list *psf;
978 978
979 spin_lock_bh(&mc->mca_lock); 979 spin_lock_bh(&mc->mca_lock);
980 for (psf=mc->mca_sources;psf;psf=psf->sf_next) { 980 for (psf = mc->mca_sources; psf; psf = psf->sf_next) {
981 if (ipv6_addr_equal(&psf->sf_addr, src_addr)) 981 if (ipv6_addr_equal(&psf->sf_addr, src_addr))
982 break; 982 break;
983 } 983 }
@@ -986,7 +986,7 @@ bool ipv6_chk_mcast_addr(struct net_device *dev, const struct in6_addr *group,
986 psf->sf_count[MCAST_EXCLUDE] != 986 psf->sf_count[MCAST_EXCLUDE] !=
987 mc->mca_sfcount[MCAST_EXCLUDE]; 987 mc->mca_sfcount[MCAST_EXCLUDE];
988 else 988 else
989 rv = mc->mca_sfcount[MCAST_EXCLUDE] !=0; 989 rv = mc->mca_sfcount[MCAST_EXCLUDE] != 0;
990 spin_unlock_bh(&mc->mca_lock); 990 spin_unlock_bh(&mc->mca_lock);
991 } else 991 } else
992 rv = true; /* don't filter unspecified source */ 992 rv = true; /* don't filter unspecified source */
@@ -1077,10 +1077,10 @@ static bool mld_xmarksources(struct ifmcaddr6 *pmc, int nsrcs,
1077 int i, scount; 1077 int i, scount;
1078 1078
1079 scount = 0; 1079 scount = 0;
1080 for (psf=pmc->mca_sources; psf; psf=psf->sf_next) { 1080 for (psf = pmc->mca_sources; psf; psf = psf->sf_next) {
1081 if (scount == nsrcs) 1081 if (scount == nsrcs)
1082 break; 1082 break;
1083 for (i=0; i<nsrcs; i++) { 1083 for (i = 0; i < nsrcs; i++) {
1084 /* skip inactive filters */ 1084 /* skip inactive filters */
1085 if (psf->sf_count[MCAST_INCLUDE] || 1085 if (psf->sf_count[MCAST_INCLUDE] ||
1086 pmc->mca_sfcount[MCAST_EXCLUDE] != 1086 pmc->mca_sfcount[MCAST_EXCLUDE] !=
@@ -1110,10 +1110,10 @@ static bool mld_marksources(struct ifmcaddr6 *pmc, int nsrcs,
1110 /* mark INCLUDE-mode sources */ 1110 /* mark INCLUDE-mode sources */
1111 1111
1112 scount = 0; 1112 scount = 0;
1113 for (psf=pmc->mca_sources; psf; psf=psf->sf_next) { 1113 for (psf = pmc->mca_sources; psf; psf = psf->sf_next) {
1114 if (scount == nsrcs) 1114 if (scount == nsrcs)
1115 break; 1115 break;
1116 for (i=0; i<nsrcs; i++) { 1116 for (i = 0; i < nsrcs; i++) {
1117 if (ipv6_addr_equal(&srcs[i], &psf->sf_addr)) { 1117 if (ipv6_addr_equal(&srcs[i], &psf->sf_addr)) {
1118 psf->sf_gsresp = 1; 1118 psf->sf_gsresp = 1;
1119 scount++; 1119 scount++;
@@ -1364,13 +1364,13 @@ int igmp6_event_query(struct sk_buff *skb)
1364 1364
1365 read_lock_bh(&idev->lock); 1365 read_lock_bh(&idev->lock);
1366 if (group_type == IPV6_ADDR_ANY) { 1366 if (group_type == IPV6_ADDR_ANY) {
1367 for (ma = idev->mc_list; ma; ma=ma->next) { 1367 for (ma = idev->mc_list; ma; ma = ma->next) {
1368 spin_lock_bh(&ma->mca_lock); 1368 spin_lock_bh(&ma->mca_lock);
1369 igmp6_group_queried(ma, max_delay); 1369 igmp6_group_queried(ma, max_delay);
1370 spin_unlock_bh(&ma->mca_lock); 1370 spin_unlock_bh(&ma->mca_lock);
1371 } 1371 }
1372 } else { 1372 } else {
1373 for (ma = idev->mc_list; ma; ma=ma->next) { 1373 for (ma = idev->mc_list; ma; ma = ma->next) {
1374 if (!ipv6_addr_equal(group, &ma->mca_addr)) 1374 if (!ipv6_addr_equal(group, &ma->mca_addr))
1375 continue; 1375 continue;
1376 spin_lock_bh(&ma->mca_lock); 1376 spin_lock_bh(&ma->mca_lock);
@@ -1434,7 +1434,7 @@ int igmp6_event_report(struct sk_buff *skb)
1434 */ 1434 */
1435 1435
1436 read_lock_bh(&idev->lock); 1436 read_lock_bh(&idev->lock);
1437 for (ma = idev->mc_list; ma; ma=ma->next) { 1437 for (ma = idev->mc_list; ma; ma = ma->next) {
1438 if (ipv6_addr_equal(&ma->mca_addr, &mld->mld_mca)) { 1438 if (ipv6_addr_equal(&ma->mca_addr, &mld->mld_mca)) {
1439 spin_lock(&ma->mca_lock); 1439 spin_lock(&ma->mca_lock);
1440 if (del_timer(&ma->mca_timer)) 1440 if (del_timer(&ma->mca_timer))
@@ -1498,7 +1498,7 @@ mld_scount(struct ifmcaddr6 *pmc, int type, int gdeleted, int sdeleted)
1498 struct ip6_sf_list *psf; 1498 struct ip6_sf_list *psf;
1499 int scount = 0; 1499 int scount = 0;
1500 1500
1501 for (psf=pmc->mca_sources; psf; psf=psf->sf_next) { 1501 for (psf = pmc->mca_sources; psf; psf = psf->sf_next) {
1502 if (!is_in(pmc, psf, type, gdeleted, sdeleted)) 1502 if (!is_in(pmc, psf, type, gdeleted, sdeleted))
1503 continue; 1503 continue;
1504 scount++; 1504 scount++;
@@ -1712,7 +1712,7 @@ static struct sk_buff *add_grec(struct sk_buff *skb, struct ifmcaddr6 *pmc,
1712 } 1712 }
1713 first = 1; 1713 first = 1;
1714 psf_prev = NULL; 1714 psf_prev = NULL;
1715 for (psf=*psf_list; psf; psf=psf_next) { 1715 for (psf = *psf_list; psf; psf = psf_next) {
1716 struct in6_addr *psrc; 1716 struct in6_addr *psrc;
1717 1717
1718 psf_next = psf->sf_next; 1718 psf_next = psf->sf_next;
@@ -1791,7 +1791,7 @@ static void mld_send_report(struct inet6_dev *idev, struct ifmcaddr6 *pmc)
1791 1791
1792 read_lock_bh(&idev->lock); 1792 read_lock_bh(&idev->lock);
1793 if (!pmc) { 1793 if (!pmc) {
1794 for (pmc=idev->mc_list; pmc; pmc=pmc->next) { 1794 for (pmc = idev->mc_list; pmc; pmc = pmc->next) {
1795 if (pmc->mca_flags & MAF_NOREPORT) 1795 if (pmc->mca_flags & MAF_NOREPORT)
1796 continue; 1796 continue;
1797 spin_lock_bh(&pmc->mca_lock); 1797 spin_lock_bh(&pmc->mca_lock);
@@ -1824,7 +1824,7 @@ static void mld_clear_zeros(struct ip6_sf_list **ppsf)
1824 struct ip6_sf_list *psf_prev, *psf_next, *psf; 1824 struct ip6_sf_list *psf_prev, *psf_next, *psf;
1825 1825
1826 psf_prev = NULL; 1826 psf_prev = NULL;
1827 for (psf=*ppsf; psf; psf = psf_next) { 1827 for (psf = *ppsf; psf; psf = psf_next) {
1828 psf_next = psf->sf_next; 1828 psf_next = psf->sf_next;
1829 if (psf->sf_crcount == 0) { 1829 if (psf->sf_crcount == 0) {
1830 if (psf_prev) 1830 if (psf_prev)
@@ -1848,7 +1848,7 @@ static void mld_send_cr(struct inet6_dev *idev)
1848 1848
1849 /* deleted MCA's */ 1849 /* deleted MCA's */
1850 pmc_prev = NULL; 1850 pmc_prev = NULL;
1851 for (pmc=idev->mc_tomb; pmc; pmc=pmc_next) { 1851 for (pmc = idev->mc_tomb; pmc; pmc = pmc_next) {
1852 pmc_next = pmc->next; 1852 pmc_next = pmc->next;
1853 if (pmc->mca_sfmode == MCAST_INCLUDE) { 1853 if (pmc->mca_sfmode == MCAST_INCLUDE) {
1854 type = MLD2_BLOCK_OLD_SOURCES; 1854 type = MLD2_BLOCK_OLD_SOURCES;
@@ -1881,7 +1881,7 @@ static void mld_send_cr(struct inet6_dev *idev)
1881 spin_unlock(&idev->mc_lock); 1881 spin_unlock(&idev->mc_lock);
1882 1882
1883 /* change recs */ 1883 /* change recs */
1884 for (pmc=idev->mc_list; pmc; pmc=pmc->next) { 1884 for (pmc = idev->mc_list; pmc; pmc = pmc->next) {
1885 spin_lock_bh(&pmc->mca_lock); 1885 spin_lock_bh(&pmc->mca_lock);
1886 if (pmc->mca_sfcount[MCAST_EXCLUDE]) { 1886 if (pmc->mca_sfcount[MCAST_EXCLUDE]) {
1887 type = MLD2_BLOCK_OLD_SOURCES; 1887 type = MLD2_BLOCK_OLD_SOURCES;
@@ -2018,7 +2018,7 @@ static void mld_send_initial_cr(struct inet6_dev *idev)
2018 2018
2019 skb = NULL; 2019 skb = NULL;
2020 read_lock_bh(&idev->lock); 2020 read_lock_bh(&idev->lock);
2021 for (pmc=idev->mc_list; pmc; pmc=pmc->next) { 2021 for (pmc = idev->mc_list; pmc; pmc = pmc->next) {
2022 spin_lock_bh(&pmc->mca_lock); 2022 spin_lock_bh(&pmc->mca_lock);
2023 if (pmc->mca_sfcount[MCAST_EXCLUDE]) 2023 if (pmc->mca_sfcount[MCAST_EXCLUDE])
2024 type = MLD2_CHANGE_TO_EXCLUDE; 2024 type = MLD2_CHANGE_TO_EXCLUDE;
@@ -2063,7 +2063,7 @@ static int ip6_mc_del1_src(struct ifmcaddr6 *pmc, int sfmode,
2063 int rv = 0; 2063 int rv = 0;
2064 2064
2065 psf_prev = NULL; 2065 psf_prev = NULL;
2066 for (psf=pmc->mca_sources; psf; psf=psf->sf_next) { 2066 for (psf = pmc->mca_sources; psf; psf = psf->sf_next) {
2067 if (ipv6_addr_equal(&psf->sf_addr, psfsrc)) 2067 if (ipv6_addr_equal(&psf->sf_addr, psfsrc))
2068 break; 2068 break;
2069 psf_prev = psf; 2069 psf_prev = psf;
@@ -2104,7 +2104,7 @@ static int ip6_mc_del_src(struct inet6_dev *idev, const struct in6_addr *pmca,
2104 if (!idev) 2104 if (!idev)
2105 return -ENODEV; 2105 return -ENODEV;
2106 read_lock_bh(&idev->lock); 2106 read_lock_bh(&idev->lock);
2107 for (pmc=idev->mc_list; pmc; pmc=pmc->next) { 2107 for (pmc = idev->mc_list; pmc; pmc = pmc->next) {
2108 if (ipv6_addr_equal(pmca, &pmc->mca_addr)) 2108 if (ipv6_addr_equal(pmca, &pmc->mca_addr))
2109 break; 2109 break;
2110 } 2110 }
@@ -2124,7 +2124,7 @@ static int ip6_mc_del_src(struct inet6_dev *idev, const struct in6_addr *pmca,
2124 pmc->mca_sfcount[sfmode]--; 2124 pmc->mca_sfcount[sfmode]--;
2125 } 2125 }
2126 err = 0; 2126 err = 0;
2127 for (i=0; i<sfcount; i++) { 2127 for (i = 0; i < sfcount; i++) {
2128 int rv = ip6_mc_del1_src(pmc, sfmode, &psfsrc[i]); 2128 int rv = ip6_mc_del1_src(pmc, sfmode, &psfsrc[i]);
2129 2129
2130 changerec |= rv > 0; 2130 changerec |= rv > 0;
@@ -2140,7 +2140,7 @@ static int ip6_mc_del_src(struct inet6_dev *idev, const struct in6_addr *pmca,
2140 pmc->mca_sfmode = MCAST_INCLUDE; 2140 pmc->mca_sfmode = MCAST_INCLUDE;
2141 pmc->mca_crcount = idev->mc_qrv; 2141 pmc->mca_crcount = idev->mc_qrv;
2142 idev->mc_ifc_count = pmc->mca_crcount; 2142 idev->mc_ifc_count = pmc->mca_crcount;
2143 for (psf=pmc->mca_sources; psf; psf = psf->sf_next) 2143 for (psf = pmc->mca_sources; psf; psf = psf->sf_next)
2144 psf->sf_crcount = 0; 2144 psf->sf_crcount = 0;
2145 mld_ifc_event(pmc->idev); 2145 mld_ifc_event(pmc->idev);
2146 } else if (sf_setstate(pmc) || changerec) 2146 } else if (sf_setstate(pmc) || changerec)
@@ -2159,7 +2159,7 @@ static int ip6_mc_add1_src(struct ifmcaddr6 *pmc, int sfmode,
2159 struct ip6_sf_list *psf, *psf_prev; 2159 struct ip6_sf_list *psf, *psf_prev;
2160 2160
2161 psf_prev = NULL; 2161 psf_prev = NULL;
2162 for (psf=pmc->mca_sources; psf; psf=psf->sf_next) { 2162 for (psf = pmc->mca_sources; psf; psf = psf->sf_next) {
2163 if (ipv6_addr_equal(&psf->sf_addr, psfsrc)) 2163 if (ipv6_addr_equal(&psf->sf_addr, psfsrc))
2164 break; 2164 break;
2165 psf_prev = psf; 2165 psf_prev = psf;
@@ -2184,7 +2184,7 @@ static void sf_markstate(struct ifmcaddr6 *pmc)
2184 struct ip6_sf_list *psf; 2184 struct ip6_sf_list *psf;
2185 int mca_xcount = pmc->mca_sfcount[MCAST_EXCLUDE]; 2185 int mca_xcount = pmc->mca_sfcount[MCAST_EXCLUDE];
2186 2186
2187 for (psf=pmc->mca_sources; psf; psf=psf->sf_next) 2187 for (psf = pmc->mca_sources; psf; psf = psf->sf_next)
2188 if (pmc->mca_sfcount[MCAST_EXCLUDE]) { 2188 if (pmc->mca_sfcount[MCAST_EXCLUDE]) {
2189 psf->sf_oldin = mca_xcount == 2189 psf->sf_oldin = mca_xcount ==
2190 psf->sf_count[MCAST_EXCLUDE] && 2190 psf->sf_count[MCAST_EXCLUDE] &&
@@ -2201,7 +2201,7 @@ static int sf_setstate(struct ifmcaddr6 *pmc)
2201 int new_in, rv; 2201 int new_in, rv;
2202 2202
2203 rv = 0; 2203 rv = 0;
2204 for (psf=pmc->mca_sources; psf; psf=psf->sf_next) { 2204 for (psf = pmc->mca_sources; psf; psf = psf->sf_next) {
2205 if (pmc->mca_sfcount[MCAST_EXCLUDE]) { 2205 if (pmc->mca_sfcount[MCAST_EXCLUDE]) {
2206 new_in = mca_xcount == psf->sf_count[MCAST_EXCLUDE] && 2206 new_in = mca_xcount == psf->sf_count[MCAST_EXCLUDE] &&
2207 !psf->sf_count[MCAST_INCLUDE]; 2207 !psf->sf_count[MCAST_INCLUDE];
@@ -2211,8 +2211,8 @@ static int sf_setstate(struct ifmcaddr6 *pmc)
2211 if (!psf->sf_oldin) { 2211 if (!psf->sf_oldin) {
2212 struct ip6_sf_list *prev = NULL; 2212 struct ip6_sf_list *prev = NULL;
2213 2213
2214 for (dpsf=pmc->mca_tomb; dpsf; 2214 for (dpsf = pmc->mca_tomb; dpsf;
2215 dpsf=dpsf->sf_next) { 2215 dpsf = dpsf->sf_next) {
2216 if (ipv6_addr_equal(&dpsf->sf_addr, 2216 if (ipv6_addr_equal(&dpsf->sf_addr,
2217 &psf->sf_addr)) 2217 &psf->sf_addr))
2218 break; 2218 break;
@@ -2234,7 +2234,7 @@ static int sf_setstate(struct ifmcaddr6 *pmc)
2234 * add or update "delete" records if an active filter 2234 * add or update "delete" records if an active filter
2235 * is now inactive 2235 * is now inactive
2236 */ 2236 */
2237 for (dpsf=pmc->mca_tomb; dpsf; dpsf=dpsf->sf_next) 2237 for (dpsf = pmc->mca_tomb; dpsf; dpsf = dpsf->sf_next)
2238 if (ipv6_addr_equal(&dpsf->sf_addr, 2238 if (ipv6_addr_equal(&dpsf->sf_addr,
2239 &psf->sf_addr)) 2239 &psf->sf_addr))
2240 break; 2240 break;
@@ -2268,7 +2268,7 @@ static int ip6_mc_add_src(struct inet6_dev *idev, const struct in6_addr *pmca,
2268 if (!idev) 2268 if (!idev)
2269 return -ENODEV; 2269 return -ENODEV;
2270 read_lock_bh(&idev->lock); 2270 read_lock_bh(&idev->lock);
2271 for (pmc=idev->mc_list; pmc; pmc=pmc->next) { 2271 for (pmc = idev->mc_list; pmc; pmc = pmc->next) {
2272 if (ipv6_addr_equal(pmca, &pmc->mca_addr)) 2272 if (ipv6_addr_equal(pmca, &pmc->mca_addr))
2273 break; 2273 break;
2274 } 2274 }
@@ -2284,7 +2284,7 @@ static int ip6_mc_add_src(struct inet6_dev *idev, const struct in6_addr *pmca,
2284 if (!delta) 2284 if (!delta)
2285 pmc->mca_sfcount[sfmode]++; 2285 pmc->mca_sfcount[sfmode]++;
2286 err = 0; 2286 err = 0;
2287 for (i=0; i<sfcount; i++) { 2287 for (i = 0; i < sfcount; i++) {
2288 err = ip6_mc_add1_src(pmc, sfmode, &psfsrc[i]); 2288 err = ip6_mc_add1_src(pmc, sfmode, &psfsrc[i]);
2289 if (err) 2289 if (err)
2290 break; 2290 break;
@@ -2294,7 +2294,7 @@ static int ip6_mc_add_src(struct inet6_dev *idev, const struct in6_addr *pmca,
2294 2294
2295 if (!delta) 2295 if (!delta)
2296 pmc->mca_sfcount[sfmode]--; 2296 pmc->mca_sfcount[sfmode]--;
2297 for (j=0; j<i; j++) 2297 for (j = 0; j < i; j++)
2298 ip6_mc_del1_src(pmc, sfmode, &psfsrc[j]); 2298 ip6_mc_del1_src(pmc, sfmode, &psfsrc[j]);
2299 } else if (isexclude != (pmc->mca_sfcount[MCAST_EXCLUDE] != 0)) { 2299 } else if (isexclude != (pmc->mca_sfcount[MCAST_EXCLUDE] != 0)) {
2300 struct ip6_sf_list *psf; 2300 struct ip6_sf_list *psf;
@@ -2308,7 +2308,7 @@ static int ip6_mc_add_src(struct inet6_dev *idev, const struct in6_addr *pmca,
2308 2308
2309 pmc->mca_crcount = idev->mc_qrv; 2309 pmc->mca_crcount = idev->mc_qrv;
2310 idev->mc_ifc_count = pmc->mca_crcount; 2310 idev->mc_ifc_count = pmc->mca_crcount;
2311 for (psf=pmc->mca_sources; psf; psf = psf->sf_next) 2311 for (psf = pmc->mca_sources; psf; psf = psf->sf_next)
2312 psf->sf_crcount = 0; 2312 psf->sf_crcount = 0;
2313 mld_ifc_event(idev); 2313 mld_ifc_event(idev);
2314 } else if (sf_setstate(pmc)) 2314 } else if (sf_setstate(pmc))
@@ -2322,12 +2322,12 @@ static void ip6_mc_clear_src(struct ifmcaddr6 *pmc)
2322{ 2322{
2323 struct ip6_sf_list *psf, *nextpsf; 2323 struct ip6_sf_list *psf, *nextpsf;
2324 2324
2325 for (psf=pmc->mca_tomb; psf; psf=nextpsf) { 2325 for (psf = pmc->mca_tomb; psf; psf = nextpsf) {
2326 nextpsf = psf->sf_next; 2326 nextpsf = psf->sf_next;
2327 kfree(psf); 2327 kfree(psf);
2328 } 2328 }
2329 pmc->mca_tomb = NULL; 2329 pmc->mca_tomb = NULL;
2330 for (psf=pmc->mca_sources; psf; psf=nextpsf) { 2330 for (psf = pmc->mca_sources; psf; psf = nextpsf) {
2331 nextpsf = psf->sf_next; 2331 nextpsf = psf->sf_next;
2332 kfree(psf); 2332 kfree(psf);
2333 } 2333 }
@@ -2471,7 +2471,7 @@ void ipv6_mc_down(struct inet6_dev *idev)
2471 mld_gq_stop_timer(idev); 2471 mld_gq_stop_timer(idev);
2472 mld_dad_stop_timer(idev); 2472 mld_dad_stop_timer(idev);
2473 2473
2474 for (i = idev->mc_list; i; i=i->next) 2474 for (i = idev->mc_list; i; i = i->next)
2475 igmp6_group_dropped(i); 2475 igmp6_group_dropped(i);
2476 read_unlock_bh(&idev->lock); 2476 read_unlock_bh(&idev->lock);
2477 2477
@@ -2488,7 +2488,7 @@ void ipv6_mc_up(struct inet6_dev *idev)
2488 /* Install multicast list, except for all-nodes (already installed) */ 2488 /* Install multicast list, except for all-nodes (already installed) */
2489 2489
2490 read_lock_bh(&idev->lock); 2490 read_lock_bh(&idev->lock);
2491 for (i = idev->mc_list; i; i=i->next) 2491 for (i = idev->mc_list; i; i = i->next)
2492 igmp6_group_added(i); 2492 igmp6_group_added(i);
2493 read_unlock_bh(&idev->lock); 2493 read_unlock_bh(&idev->lock);
2494} 2494}