Lines Matching refs:psf
187 static void ip_sf_list_clear_all(struct ip_sf_list *psf) in ip_sf_list_clear_all() argument
191 while (psf) { in ip_sf_list_clear_all()
192 next = psf->sf_next; in ip_sf_list_clear_all()
193 kfree(psf); in ip_sf_list_clear_all()
194 psf = next; in ip_sf_list_clear_all()
274 static int is_in(struct ip_mc_list *pmc, struct ip_sf_list *psf, int type, in is_in() argument
282 if (!(pmc->gsquery && !psf->sf_gsresp)) { in is_in()
288 if (psf->sf_count[MCAST_INCLUDE]) in is_in()
291 psf->sf_count[MCAST_EXCLUDE]; in is_in()
297 return psf->sf_count[MCAST_INCLUDE] != 0; in is_in()
302 psf->sf_count[MCAST_INCLUDE]) in is_in()
305 psf->sf_count[MCAST_EXCLUDE]; in is_in()
307 if (gdeleted || !psf->sf_crcount) in is_in()
312 return gdeleted || (psf->sf_crcount && sdeleted); in is_in()
313 return psf->sf_crcount && !gdeleted && !sdeleted; in is_in()
321 struct ip_sf_list *psf; in igmp_scount() local
324 for (psf = pmc->sources; psf; psf = psf->sf_next) { in igmp_scount()
325 if (!is_in(pmc, psf, type, gdeleted, sdeleted)) in igmp_scount()
469 struct ip_sf_list *psf, *psf_next, *psf_prev, **psf_list; in add_grec() local
508 for (psf = *psf_list; psf; psf = psf_next) { in add_grec()
511 psf_next = psf->sf_next; in add_grec()
513 if (!is_in(pmc, psf, type, gdeleted, sdeleted)) { in add_grec()
514 psf_prev = psf; in add_grec()
524 type == IGMPV3_BLOCK_OLD_SOURCES) && psf->sf_crcount) in add_grec()
529 psf->sf_gsresp = 0; in add_grec()
550 *psrc = psf->sf_inaddr; in add_grec()
553 type == IGMPV3_BLOCK_OLD_SOURCES) && psf->sf_crcount) { in add_grec()
555 psf->sf_crcount--; in add_grec()
556 if ((sdeleted || gdeleted) && psf->sf_crcount == 0) { in add_grec()
558 psf_prev->sf_next = psf->sf_next; in add_grec()
560 *psf_list = psf->sf_next; in add_grec()
561 kfree(psf); in add_grec()
565 psf_prev = psf; in add_grec()
632 struct ip_sf_list *psf_prev, *psf_next, *psf; in igmpv3_clear_zeros() local
635 for (psf = *ppsf; psf; psf = psf_next) { in igmpv3_clear_zeros()
636 psf_next = psf->sf_next; in igmpv3_clear_zeros()
637 if (psf->sf_crcount == 0) { in igmpv3_clear_zeros()
639 psf_prev->sf_next = psf->sf_next; in igmpv3_clear_zeros()
641 *ppsf = psf->sf_next; in igmpv3_clear_zeros()
642 kfree(psf); in igmpv3_clear_zeros()
644 psf_prev = psf; in igmpv3_clear_zeros()
860 struct ip_sf_list *psf; in igmp_xmarksources() local
864 for (psf = pmc->sources; psf; psf = psf->sf_next) { in igmp_xmarksources()
869 if (psf->sf_count[MCAST_INCLUDE] || in igmp_xmarksources()
871 psf->sf_count[MCAST_EXCLUDE]) in igmp_xmarksources()
873 if (srcs[i] == psf->sf_inaddr) { in igmp_xmarksources()
887 struct ip_sf_list *psf; in igmp_marksources() local
895 for (psf = pmc->sources; psf; psf = psf->sf_next) { in igmp_marksources()
899 if (srcs[i] == psf->sf_inaddr) { in igmp_marksources()
900 psf->sf_gsresp = 1; in igmp_marksources()
1193 struct ip_sf_list *psf; in igmpv3_add_delrec() local
1198 for (psf = pmc->sources; psf; psf = psf->sf_next) in igmpv3_add_delrec()
1199 psf->sf_crcount = pmc->crcount; in igmpv3_add_delrec()
1215 struct ip_sf_list *psf; in igmpv3_del_delrec() local
1240 for (psf = im->sources; psf; psf = psf->sf_next) in igmpv3_del_delrec()
1241 psf->sf_crcount = in_dev->mr_qrv ?: in igmpv3_del_delrec()
1274 struct ip_sf_list *psf; in igmpv3_clear_delrec() local
1277 psf = pmc->tomb; in igmpv3_clear_delrec()
1280 ip_sf_list_clear_all(psf); in igmpv3_clear_delrec()
1860 struct ip_sf_list *psf, *psf_prev; in ip_mc_del1_src() local
1864 for (psf = pmc->sources; psf; psf = psf->sf_next) { in ip_mc_del1_src()
1865 if (psf->sf_inaddr == *psfsrc) in ip_mc_del1_src()
1867 psf_prev = psf; in ip_mc_del1_src()
1869 if (!psf || psf->sf_count[sfmode] == 0) { in ip_mc_del1_src()
1873 psf->sf_count[sfmode]--; in ip_mc_del1_src()
1874 if (psf->sf_count[sfmode] == 0) { in ip_mc_del1_src()
1877 if (!psf->sf_count[MCAST_INCLUDE] && !psf->sf_count[MCAST_EXCLUDE]) { in ip_mc_del1_src()
1885 psf_prev->sf_next = psf->sf_next; in ip_mc_del1_src()
1887 pmc->sources = psf->sf_next; in ip_mc_del1_src()
1889 if (psf->sf_oldin && in ip_mc_del1_src()
1891 psf->sf_crcount = in_dev->mr_qrv ?: READ_ONCE(net->ipv4.sysctl_igmp_qrv); in ip_mc_del1_src()
1892 psf->sf_next = pmc->tomb; in ip_mc_del1_src()
1893 pmc->tomb = psf; in ip_mc_del1_src()
1897 kfree(psf); in ip_mc_del1_src()
1948 struct ip_sf_list *psf; in ip_mc_del_src() local
1957 for (psf = pmc->sources; psf; psf = psf->sf_next) in ip_mc_del_src()
1958 psf->sf_crcount = 0; in ip_mc_del_src()
1975 struct ip_sf_list *psf, *psf_prev; in ip_mc_add1_src() local
1978 for (psf = pmc->sources; psf; psf = psf->sf_next) { in ip_mc_add1_src()
1979 if (psf->sf_inaddr == *psfsrc) in ip_mc_add1_src()
1981 psf_prev = psf; in ip_mc_add1_src()
1983 if (!psf) { in ip_mc_add1_src()
1984 psf = kzalloc(sizeof(*psf), GFP_ATOMIC); in ip_mc_add1_src()
1985 if (!psf) in ip_mc_add1_src()
1987 psf->sf_inaddr = *psfsrc; in ip_mc_add1_src()
1989 psf_prev->sf_next = psf; in ip_mc_add1_src()
1991 pmc->sources = psf; in ip_mc_add1_src()
1993 psf->sf_count[sfmode]++; in ip_mc_add1_src()
1994 if (psf->sf_count[sfmode] == 1) { in ip_mc_add1_src()
2003 struct ip_sf_list *psf; in sf_markstate() local
2006 for (psf = pmc->sources; psf; psf = psf->sf_next) in sf_markstate()
2008 psf->sf_oldin = mca_xcount == in sf_markstate()
2009 psf->sf_count[MCAST_EXCLUDE] && in sf_markstate()
2010 !psf->sf_count[MCAST_INCLUDE]; in sf_markstate()
2012 psf->sf_oldin = psf->sf_count[MCAST_INCLUDE] != 0; in sf_markstate()
2017 struct ip_sf_list *psf, *dpsf; in sf_setstate() local
2023 for (psf = pmc->sources; psf; psf = psf->sf_next) { in sf_setstate()
2025 new_in = mca_xcount == psf->sf_count[MCAST_EXCLUDE] && in sf_setstate()
2026 !psf->sf_count[MCAST_INCLUDE]; in sf_setstate()
2028 new_in = psf->sf_count[MCAST_INCLUDE] != 0; in sf_setstate()
2030 if (!psf->sf_oldin) { in sf_setstate()
2034 if (dpsf->sf_inaddr == psf->sf_inaddr) in sf_setstate()
2045 psf->sf_crcount = qrv; in sf_setstate()
2048 } else if (psf->sf_oldin) { in sf_setstate()
2050 psf->sf_crcount = 0; in sf_setstate()
2056 if (dpsf->sf_inaddr == psf->sf_inaddr) in sf_setstate()
2062 *dpsf = *psf; in sf_setstate()
2121 struct ip_sf_list *psf; in ip_mc_add_src() local
2136 for (psf = pmc->sources; psf; psf = psf->sf_next) in ip_mc_add_src()
2137 psf->sf_crcount = 0; in ip_mc_add_src()
2236 struct ip_sf_socklist *psf = rtnl_dereference(iml->sflist); in ip_mc_leave_src() local
2239 if (!psf) { in ip_mc_leave_src()
2245 iml->sfmode, psf->sl_count, psf->sl_addr, 0); in ip_mc_leave_src()
2248 atomic_sub(IP_SFLSIZE(psf->sl_max), &sk->sk_omem_alloc); in ip_mc_leave_src()
2249 kfree_rcu(psf, rcu); in ip_mc_leave_src()
2716 struct ip_sf_list *psf; in ip_check_mc_rcu() local
2740 for (psf = im->sources; psf; psf = psf->sf_next) { in ip_check_mc_rcu()
2741 if (psf->sf_inaddr == src_addr) in ip_check_mc_rcu()
2744 if (psf) in ip_check_mc_rcu()
2745 rv = psf->sf_count[MCAST_INCLUDE] || in ip_check_mc_rcu()
2746 psf->sf_count[MCAST_EXCLUDE] != in ip_check_mc_rcu()
2898 struct ip_sf_list *psf = NULL; in igmp_mcf_get_first() local
2912 psf = im->sources; in igmp_mcf_get_first()
2913 if (likely(psf)) { in igmp_mcf_get_first()
2921 return psf; in igmp_mcf_get_first()
2924 static struct ip_sf_list *igmp_mcf_get_next(struct seq_file *seq, struct ip_sf_list *psf) in igmp_mcf_get_next() argument
2928 psf = psf->sf_next; in igmp_mcf_get_next()
2929 while (!psf) { in igmp_mcf_get_next()
2946 psf = state->im->sources; in igmp_mcf_get_next()
2949 return psf; in igmp_mcf_get_next()
2954 struct ip_sf_list *psf = igmp_mcf_get_first(seq); in igmp_mcf_get_idx() local
2955 if (psf) in igmp_mcf_get_idx()
2956 while (pos && (psf = igmp_mcf_get_next(seq, psf)) != NULL) in igmp_mcf_get_idx()
2958 return pos ? NULL : psf; in igmp_mcf_get_idx()
2970 struct ip_sf_list *psf; in igmp_mcf_seq_next() local
2972 psf = igmp_mcf_get_first(seq); in igmp_mcf_seq_next()
2974 psf = igmp_mcf_get_next(seq, v); in igmp_mcf_seq_next()
2976 return psf; in igmp_mcf_seq_next()
2994 struct ip_sf_list *psf = (struct ip_sf_list *)v; in igmp_mcf_seq_show() local
3005 ntohl(psf->sf_inaddr), in igmp_mcf_seq_show()
3006 psf->sf_count[MCAST_INCLUDE], in igmp_mcf_seq_show()
3007 psf->sf_count[MCAST_EXCLUDE]); in igmp_mcf_seq_show()