Lines Matching refs:in_dev
122 #define IGMP_V1_SEEN(in_dev) \ argument
123 (IPV4_DEVCONF_ALL(dev_net(in_dev->dev), FORCE_IGMP_VERSION) == 1 || \
124 IN_DEV_CONF_GET((in_dev), FORCE_IGMP_VERSION) == 1 || \
125 ((in_dev)->mr_v1_seen && \
126 time_before(jiffies, (in_dev)->mr_v1_seen)))
127 #define IGMP_V2_SEEN(in_dev) \ argument
128 (IPV4_DEVCONF_ALL(dev_net(in_dev->dev), FORCE_IGMP_VERSION) == 2 || \
129 IN_DEV_CONF_GET((in_dev), FORCE_IGMP_VERSION) == 2 || \
130 ((in_dev)->mr_v2_seen && \
131 time_before(jiffies, (in_dev)->mr_v2_seen)))
133 static int unsolicited_report_interval(struct in_device *in_dev) in unsolicited_report_interval() argument
137 if (IGMP_V1_SEEN(in_dev) || IGMP_V2_SEEN(in_dev)) in unsolicited_report_interval()
139 in_dev, in unsolicited_report_interval()
143 in_dev, in unsolicited_report_interval()
156 static void igmpv3_add_delrec(struct in_device *in_dev, struct ip_mc_list *im,
158 static void igmpv3_del_delrec(struct in_device *in_dev, struct ip_mc_list *im);
159 static void igmpv3_clear_delrec(struct in_device *in_dev);
164 static int ip_mc_add_src(struct in_device *in_dev, __be32 *pmca, int sfmode,
175 #define for_each_pmc_rcu(in_dev, pmc) \ argument
176 for (pmc = rcu_dereference(in_dev->mc_list); \
180 #define for_each_pmc_rtnl(in_dev, pmc) \ argument
181 for (pmc = rtnl_dereference(in_dev->mc_list); \
225 static void igmp_gq_start_timer(struct in_device *in_dev) in igmp_gq_start_timer() argument
227 int tv = get_random_u32_below(in_dev->mr_maxdelay); in igmp_gq_start_timer()
230 if (in_dev->mr_gq_running && in igmp_gq_start_timer()
231 time_after_eq(exp, (in_dev->mr_gq_timer).expires)) in igmp_gq_start_timer()
234 in_dev->mr_gq_running = 1; in igmp_gq_start_timer()
235 if (!mod_timer(&in_dev->mr_gq_timer, exp)) in igmp_gq_start_timer()
236 in_dev_hold(in_dev); in igmp_gq_start_timer()
239 static void igmp_ifc_start_timer(struct in_device *in_dev, int delay) in igmp_ifc_start_timer() argument
243 if (!mod_timer(&in_dev->mr_ifc_timer, jiffies+tv+2)) in igmp_ifc_start_timer()
244 in_dev_hold(in_dev); in igmp_ifc_start_timer()
334 struct in_device *in_dev = __in_dev_get_rcu(dev); in igmpv3_get_srcaddr() local
337 if (!in_dev) in igmpv3_get_srcaddr()
340 in_dev_for_each_ifa_rcu(ifa, in_dev) { in igmpv3_get_srcaddr()
588 static int igmpv3_send_report(struct in_device *in_dev, struct ip_mc_list *pmc) in igmpv3_send_report() argument
591 struct net *net = dev_net(in_dev->dev); in igmpv3_send_report()
596 for_each_pmc_rcu(in_dev, pmc) { in igmpv3_send_report()
653 static void igmpv3_send_cr(struct in_device *in_dev) in igmpv3_send_cr() argument
660 spin_lock_bh(&in_dev->mc_tomb_lock); in igmpv3_send_cr()
664 for (pmc = in_dev->mc_tomb; pmc; pmc = pmc_next) { in igmpv3_send_cr()
687 in_dev->mc_tomb = pmc_next; in igmpv3_send_cr()
693 spin_unlock_bh(&in_dev->mc_tomb_lock); in igmpv3_send_cr()
696 for_each_pmc_rcu(in_dev, pmc) { in igmpv3_send_cr()
726 static int igmp_send_report(struct in_device *in_dev, struct ip_mc_list *pmc, in igmp_send_report() argument
733 struct net_device *dev = in_dev->dev; in igmp_send_report()
741 return igmpv3_send_report(in_dev, pmc); in igmp_send_report()
801 struct in_device *in_dev = from_timer(in_dev, t, mr_gq_timer); in igmp_gq_timer_expire() local
803 in_dev->mr_gq_running = 0; in igmp_gq_timer_expire()
804 igmpv3_send_report(in_dev, NULL); in igmp_gq_timer_expire()
805 in_dev_put(in_dev); in igmp_gq_timer_expire()
810 struct in_device *in_dev = from_timer(in_dev, t, mr_ifc_timer); in igmp_ifc_timer_expire() local
813 igmpv3_send_cr(in_dev); in igmp_ifc_timer_expire()
815 mr_ifc_count = READ_ONCE(in_dev->mr_ifc_count); in igmp_ifc_timer_expire()
818 if (cmpxchg(&in_dev->mr_ifc_count, in igmp_ifc_timer_expire()
822 igmp_ifc_start_timer(in_dev, in igmp_ifc_timer_expire()
823 unsolicited_report_interval(in_dev)); in igmp_ifc_timer_expire()
825 in_dev_put(in_dev); in igmp_ifc_timer_expire()
828 static void igmp_ifc_event(struct in_device *in_dev) in igmp_ifc_event() argument
830 struct net *net = dev_net(in_dev->dev); in igmp_ifc_event()
831 if (IGMP_V1_SEEN(in_dev) || IGMP_V2_SEEN(in_dev)) in igmp_ifc_event()
833 WRITE_ONCE(in_dev->mr_ifc_count, in_dev->mr_qrv ?: READ_ONCE(net->ipv4.sysctl_igmp_qrv)); in igmp_ifc_event()
834 igmp_ifc_start_timer(in_dev, 1); in igmp_ifc_event()
841 struct in_device *in_dev = im->interface; in igmp_timer_expire() local
847 igmp_start_timer(im, unsolicited_report_interval(in_dev)); in igmp_timer_expire()
852 if (IGMP_V1_SEEN(in_dev)) in igmp_timer_expire()
853 igmp_send_report(in_dev, im, IGMP_HOST_MEMBERSHIP_REPORT); in igmp_timer_expire()
854 else if (IGMP_V2_SEEN(in_dev)) in igmp_timer_expire()
855 igmp_send_report(in_dev, im, IGMPV2_HOST_MEMBERSHIP_REPORT); in igmp_timer_expire()
857 igmp_send_report(in_dev, im, IGMPV3_HOST_MEMBERSHIP_REPORT); in igmp_timer_expire()
919 static bool igmp_heard_report(struct in_device *in_dev, __be32 group) in igmp_heard_report() argument
922 struct net *net = dev_net(in_dev->dev); in igmp_heard_report()
933 for_each_pmc_rcu(in_dev, im) { in igmp_heard_report()
944 static bool igmp_heard_query(struct in_device *in_dev, struct sk_buff *skb, in igmp_heard_query() argument
953 struct net *net = dev_net(in_dev->dev); in igmp_heard_query()
961 in_dev->mr_v1_seen = jiffies + in igmp_heard_query()
962 (in_dev->mr_qrv * in_dev->mr_qi) + in igmp_heard_query()
963 in_dev->mr_qri; in igmp_heard_query()
968 in_dev->mr_v2_seen = jiffies + in igmp_heard_query()
969 (in_dev->mr_qrv * in_dev->mr_qi) + in igmp_heard_query()
970 in_dev->mr_qri; in igmp_heard_query()
973 WRITE_ONCE(in_dev->mr_ifc_count, 0); in igmp_heard_query()
974 if (del_timer(&in_dev->mr_ifc_timer)) in igmp_heard_query()
975 __in_dev_put(in_dev); in igmp_heard_query()
977 igmpv3_clear_delrec(in_dev); in igmp_heard_query()
980 } else if (IGMP_V1_SEEN(in_dev)) { in igmp_heard_query()
984 } else if (IGMP_V2_SEEN(in_dev)) { in igmp_heard_query()
1009 in_dev->mr_maxdelay = max_delay; in igmp_heard_query()
1015 in_dev->mr_qrv = ih3->qrv ?: READ_ONCE(net->ipv4.sysctl_igmp_qrv); in igmp_heard_query()
1016 in_dev->mr_qi = IGMPV3_QQIC(ih3->qqic)*HZ ?: IGMP_QUERY_INTERVAL; in igmp_heard_query()
1022 if (in_dev->mr_qri >= in_dev->mr_qi) in igmp_heard_query()
1023 in_dev->mr_qri = (in_dev->mr_qi/HZ - 1)*HZ; in igmp_heard_query()
1028 igmp_gq_start_timer(in_dev); in igmp_heard_query()
1046 for_each_pmc_rcu(in_dev, im) { in igmp_heard_query()
1077 struct in_device *in_dev; in igmp_rcv() local
1087 in_dev = __in_dev_get_rcu(dev); in igmp_rcv()
1088 if (!in_dev) in igmp_rcv()
1100 dropped = igmp_heard_query(in_dev, skb, len); in igmp_rcv()
1110 dropped = igmp_heard_report(in_dev, ih->group); in igmp_rcv()
1142 static void ip_mc_filter_add(struct in_device *in_dev, __be32 addr) in ip_mc_filter_add() argument
1145 struct net_device *dev = in_dev->dev; in ip_mc_filter_add()
1162 static void ip_mc_filter_del(struct in_device *in_dev, __be32 addr) in ip_mc_filter_del() argument
1165 struct net_device *dev = in_dev->dev; in ip_mc_filter_del()
1175 static void igmpv3_add_delrec(struct in_device *in_dev, struct ip_mc_list *im, in igmpv3_add_delrec() argument
1179 struct net *net = dev_net(in_dev->dev); in igmpv3_add_delrec()
1193 in_dev_hold(in_dev); in igmpv3_add_delrec()
1195 pmc->crcount = in_dev->mr_qrv ?: READ_ONCE(net->ipv4.sysctl_igmp_qrv); in igmpv3_add_delrec()
1208 spin_lock_bh(&in_dev->mc_tomb_lock); in igmpv3_add_delrec()
1209 pmc->next = in_dev->mc_tomb; in igmpv3_add_delrec()
1210 in_dev->mc_tomb = pmc; in igmpv3_add_delrec()
1211 spin_unlock_bh(&in_dev->mc_tomb_lock); in igmpv3_add_delrec()
1217 static void igmpv3_del_delrec(struct in_device *in_dev, struct ip_mc_list *im) in igmpv3_del_delrec() argument
1221 struct net *net = dev_net(in_dev->dev); in igmpv3_del_delrec()
1224 spin_lock_bh(&in_dev->mc_tomb_lock); in igmpv3_del_delrec()
1226 for (pmc = in_dev->mc_tomb; pmc; pmc = pmc->next) { in igmpv3_del_delrec()
1235 in_dev->mc_tomb = pmc->next; in igmpv3_del_delrec()
1237 spin_unlock_bh(&in_dev->mc_tomb_lock); in igmpv3_del_delrec()
1246 psf->sf_crcount = in_dev->mr_qrv ?: in igmpv3_del_delrec()
1249 im->crcount = in_dev->mr_qrv ?: in igmpv3_del_delrec()
1261 static void igmpv3_clear_delrec(struct in_device *in_dev) in igmpv3_clear_delrec() argument
1265 spin_lock_bh(&in_dev->mc_tomb_lock); in igmpv3_clear_delrec()
1266 pmc = in_dev->mc_tomb; in igmpv3_clear_delrec()
1267 in_dev->mc_tomb = NULL; in igmpv3_clear_delrec()
1268 spin_unlock_bh(&in_dev->mc_tomb_lock); in igmpv3_clear_delrec()
1278 for_each_pmc_rcu(in_dev, pmc) { in igmpv3_clear_delrec()
1293 struct in_device *in_dev = im->interface; in __igmp_group_dropped() local
1295 struct net *net = dev_net(in_dev->dev); in __igmp_group_dropped()
1301 ip_mc_filter_del(in_dev, im->multiaddr); in __igmp_group_dropped()
1314 if (!in_dev->dead) { in __igmp_group_dropped()
1315 if (IGMP_V1_SEEN(in_dev)) in __igmp_group_dropped()
1317 if (IGMP_V2_SEEN(in_dev)) { in __igmp_group_dropped()
1319 igmp_send_report(in_dev, im, IGMP_HOST_LEAVE_MESSAGE); in __igmp_group_dropped()
1323 igmpv3_add_delrec(in_dev, im, gfp); in __igmp_group_dropped()
1325 igmp_ifc_event(in_dev); in __igmp_group_dropped()
1337 struct in_device *in_dev = im->interface; in igmp_group_added() local
1339 struct net *net = dev_net(in_dev->dev); in igmp_group_added()
1344 ip_mc_filter_add(in_dev, im->multiaddr); in igmp_group_added()
1354 if (in_dev->dead) in igmp_group_added()
1358 if (IGMP_V1_SEEN(in_dev) || IGMP_V2_SEEN(in_dev)) { in igmp_group_added()
1371 im->crcount = in_dev->mr_qrv ?: READ_ONCE(net->ipv4.sysctl_igmp_qrv); in igmp_group_added()
1373 igmp_ifc_event(in_dev); in igmp_group_added()
1387 static void ip_mc_hash_add(struct in_device *in_dev, in ip_mc_hash_add() argument
1393 mc_hash = rtnl_dereference(in_dev->mc_hash); in ip_mc_hash_add()
1402 if (in_dev->mc_count < 4) in ip_mc_hash_add()
1410 for_each_pmc_rtnl(in_dev, im) { in ip_mc_hash_add()
1416 rcu_assign_pointer(in_dev->mc_hash, mc_hash); in ip_mc_hash_add()
1419 static void ip_mc_hash_remove(struct in_device *in_dev, in ip_mc_hash_remove() argument
1422 struct ip_mc_list __rcu **mc_hash = rtnl_dereference(in_dev->mc_hash); in ip_mc_hash_remove()
1437 static void ____ip_mc_inc_group(struct in_device *in_dev, __be32 addr, in ____ip_mc_inc_group() argument
1444 for_each_pmc_rtnl(in_dev, im) { in ____ip_mc_inc_group()
1447 ip_mc_add_src(in_dev, &addr, mode, 0, NULL, 0); in ____ip_mc_inc_group()
1457 im->interface = in_dev; in ____ip_mc_inc_group()
1458 in_dev_hold(in_dev); in ____ip_mc_inc_group()
1469 im->next_rcu = in_dev->mc_list; in ____ip_mc_inc_group()
1470 in_dev->mc_count++; in ____ip_mc_inc_group()
1471 rcu_assign_pointer(in_dev->mc_list, im); in ____ip_mc_inc_group()
1473 ip_mc_hash_add(in_dev, im); in ____ip_mc_inc_group()
1476 igmpv3_del_delrec(in_dev, im); in ____ip_mc_inc_group()
1479 if (!in_dev->dead) in ____ip_mc_inc_group()
1480 ip_rt_multicast_event(in_dev); in ____ip_mc_inc_group()
1485 void __ip_mc_inc_group(struct in_device *in_dev, __be32 addr, gfp_t gfp) in __ip_mc_inc_group() argument
1487 ____ip_mc_inc_group(in_dev, addr, MCAST_EXCLUDE, gfp); in __ip_mc_inc_group()
1491 void ip_mc_inc_group(struct in_device *in_dev, __be32 addr) in ip_mc_inc_group() argument
1493 __ip_mc_inc_group(in_dev, addr, GFP_KERNEL); in ip_mc_inc_group()
1642 static void ip_mc_rejoin_groups(struct in_device *in_dev) in ip_mc_rejoin_groups() argument
1647 struct net *net = dev_net(in_dev->dev); in ip_mc_rejoin_groups()
1651 for_each_pmc_rtnl(in_dev, im) { in ip_mc_rejoin_groups()
1661 if (IGMP_V1_SEEN(in_dev)) in ip_mc_rejoin_groups()
1663 else if (IGMP_V2_SEEN(in_dev)) in ip_mc_rejoin_groups()
1667 igmp_send_report(in_dev, im, type); in ip_mc_rejoin_groups()
1676 void __ip_mc_dec_group(struct in_device *in_dev, __be32 addr, gfp_t gfp) in __ip_mc_dec_group() argument
1683 for (ip = &in_dev->mc_list; in __ip_mc_dec_group()
1688 ip_mc_hash_remove(in_dev, i); in __ip_mc_dec_group()
1690 in_dev->mc_count--; in __ip_mc_dec_group()
1694 if (!in_dev->dead) in __ip_mc_dec_group()
1695 ip_rt_multicast_event(in_dev); in __ip_mc_dec_group()
1708 void ip_mc_unmap(struct in_device *in_dev) in ip_mc_unmap() argument
1714 for_each_pmc_rtnl(in_dev, pmc) in ip_mc_unmap()
1718 void ip_mc_remap(struct in_device *in_dev) in ip_mc_remap() argument
1724 for_each_pmc_rtnl(in_dev, pmc) { in ip_mc_remap()
1726 igmpv3_del_delrec(in_dev, pmc); in ip_mc_remap()
1734 void ip_mc_down(struct in_device *in_dev) in ip_mc_down() argument
1740 for_each_pmc_rtnl(in_dev, pmc) in ip_mc_down()
1744 WRITE_ONCE(in_dev->mr_ifc_count, 0); in ip_mc_down()
1745 if (del_timer(&in_dev->mr_ifc_timer)) in ip_mc_down()
1746 __in_dev_put(in_dev); in ip_mc_down()
1747 in_dev->mr_gq_running = 0; in ip_mc_down()
1748 if (del_timer(&in_dev->mr_gq_timer)) in ip_mc_down()
1749 __in_dev_put(in_dev); in ip_mc_down()
1752 ip_mc_dec_group(in_dev, IGMP_ALL_HOSTS); in ip_mc_down()
1756 static void ip_mc_reset(struct in_device *in_dev) in ip_mc_reset() argument
1758 struct net *net = dev_net(in_dev->dev); in ip_mc_reset()
1760 in_dev->mr_qi = IGMP_QUERY_INTERVAL; in ip_mc_reset()
1761 in_dev->mr_qri = IGMP_QUERY_RESPONSE_INTERVAL; in ip_mc_reset()
1762 in_dev->mr_qrv = READ_ONCE(net->ipv4.sysctl_igmp_qrv); in ip_mc_reset()
1765 static void ip_mc_reset(struct in_device *in_dev) in ip_mc_reset() argument
1770 void ip_mc_init_dev(struct in_device *in_dev) in ip_mc_init_dev() argument
1775 timer_setup(&in_dev->mr_gq_timer, igmp_gq_timer_expire, 0); in ip_mc_init_dev()
1776 timer_setup(&in_dev->mr_ifc_timer, igmp_ifc_timer_expire, 0); in ip_mc_init_dev()
1778 ip_mc_reset(in_dev); in ip_mc_init_dev()
1780 spin_lock_init(&in_dev->mc_tomb_lock); in ip_mc_init_dev()
1785 void ip_mc_up(struct in_device *in_dev) in ip_mc_up() argument
1791 ip_mc_reset(in_dev); in ip_mc_up()
1792 ip_mc_inc_group(in_dev, IGMP_ALL_HOSTS); in ip_mc_up()
1794 for_each_pmc_rtnl(in_dev, pmc) { in ip_mc_up()
1796 igmpv3_del_delrec(in_dev, pmc); in ip_mc_up()
1806 void ip_mc_destroy_dev(struct in_device *in_dev) in ip_mc_destroy_dev() argument
1813 ip_mc_down(in_dev); in ip_mc_destroy_dev()
1815 igmpv3_clear_delrec(in_dev); in ip_mc_destroy_dev()
1818 while ((i = rtnl_dereference(in_dev->mc_list)) != NULL) { in ip_mc_destroy_dev()
1819 in_dev->mc_list = i->next_rcu; in ip_mc_destroy_dev()
1820 in_dev->mc_count--; in ip_mc_destroy_dev()
1884 struct in_device *in_dev = pmc->interface; in ip_mc_del1_src() local
1885 struct net *net = dev_net(in_dev->dev); in ip_mc_del1_src()
1895 !IGMP_V1_SEEN(in_dev) && !IGMP_V2_SEEN(in_dev)) { in ip_mc_del1_src()
1896 psf->sf_crcount = in_dev->mr_qrv ?: READ_ONCE(net->ipv4.sysctl_igmp_qrv); in ip_mc_del1_src()
1911 static int ip_mc_del_src(struct in_device *in_dev, __be32 *pmca, int sfmode, in ip_mc_del_src() argument
1918 if (!in_dev) in ip_mc_del_src()
1921 for_each_pmc_rcu(in_dev, pmc) { in ip_mc_del_src()
1954 struct net *net = dev_net(in_dev->dev); in ip_mc_del_src()
1960 pmc->crcount = in_dev->mr_qrv ?: READ_ONCE(net->ipv4.sysctl_igmp_qrv); in ip_mc_del_src()
1961 WRITE_ONCE(in_dev->mr_ifc_count, pmc->crcount); in ip_mc_del_src()
2083 static int ip_mc_add_src(struct in_device *in_dev, __be32 *pmca, int sfmode, in ip_mc_add_src() argument
2090 if (!in_dev) in ip_mc_add_src()
2093 for_each_pmc_rcu(in_dev, pmc) { in ip_mc_add_src()
2128 in_dev = pmc->interface; in ip_mc_add_src()
2139 pmc->crcount = in_dev->mr_qrv ?: READ_ONCE(net->ipv4.sysctl_igmp_qrv); in ip_mc_add_src()
2140 WRITE_ONCE(in_dev->mr_ifc_count, pmc->crcount); in ip_mc_add_src()
2143 igmp_ifc_event(in_dev); in ip_mc_add_src()
2145 igmp_ifc_event(in_dev); in ip_mc_add_src()
2177 struct in_device *in_dev; in __ip_mc_join_group() local
2189 in_dev = ip_mc_find_dev(net, imr); in __ip_mc_join_group()
2191 if (!in_dev) { in __ip_mc_join_group()
2216 ____ip_mc_inc_group(in_dev, addr, mode, GFP_KERNEL); in __ip_mc_join_group()
2239 struct in_device *in_dev) in ip_mc_leave_src() argument
2246 return ip_mc_del_src(in_dev, &iml->multi.imr_multiaddr.s_addr, in ip_mc_leave_src()
2249 err = ip_mc_del_src(in_dev, &iml->multi.imr_multiaddr.s_addr, in ip_mc_leave_src()
2263 struct in_device *in_dev; in ip_mc_leave_group() local
2271 in_dev = ip_mc_find_dev(net, imr); in ip_mc_leave_group()
2272 if (!imr->imr_ifindex && !imr->imr_address.s_addr && !in_dev) { in ip_mc_leave_group()
2289 (void) ip_mc_leave_src(sk, iml, in_dev); in ip_mc_leave_group()
2293 if (in_dev) in ip_mc_leave_group()
2294 ip_mc_dec_group(in_dev, group); in ip_mc_leave_group()
2313 struct in_device *in_dev = NULL; in ip_mc_source() local
2328 in_dev = ip_mc_find_dev(net, &imr); in ip_mc_source()
2330 if (!in_dev) { in ip_mc_source()
2354 ip_mc_add_src(in_dev, &mreqs->imr_multiaddr, omode, 0, NULL, 0); in ip_mc_source()
2355 ip_mc_del_src(in_dev, &mreqs->imr_multiaddr, pmc->sfmode, 0, in ip_mc_source()
2381 ip_mc_del_src(in_dev, &mreqs->imr_multiaddr, omode, 1, in ip_mc_source()
2437 ip_mc_add_src(in_dev, &mreqs->imr_multiaddr, omode, 1, in ip_mc_source()
2451 struct in_device *in_dev; in ip_mc_msfilter() local
2468 in_dev = ip_mc_find_dev(net, &imr); in ip_mc_msfilter()
2470 if (!in_dev) { in ip_mc_msfilter()
2501 err = ip_mc_add_src(in_dev, &msf->imsf_multiaddr, in ip_mc_msfilter()
2511 (void) ip_mc_add_src(in_dev, &msf->imsf_multiaddr, in ip_mc_msfilter()
2516 (void) ip_mc_del_src(in_dev, &msf->imsf_multiaddr, pmc->sfmode, in ip_mc_msfilter()
2522 (void) ip_mc_del_src(in_dev, &msf->imsf_multiaddr, pmc->sfmode, in ip_mc_msfilter()
2542 struct in_device *in_dev; in ip_mc_msfget() local
2555 in_dev = ip_mc_find_dev(net, &imr); in ip_mc_msfget()
2557 if (!in_dev) { in ip_mc_msfget()
2703 struct in_device *in_dev; in ip_mc_drop_socket() local
2706 in_dev = inetdev_by_index(net, iml->multi.imr_ifindex); in ip_mc_drop_socket()
2707 (void) ip_mc_leave_src(sk, iml, in_dev); in ip_mc_drop_socket()
2708 if (in_dev) in ip_mc_drop_socket()
2709 ip_mc_dec_group(in_dev, iml->multi.imr_multiaddr.s_addr); in ip_mc_drop_socket()
2718 int ip_check_mc_rcu(struct in_device *in_dev, __be32 mc_addr, __be32 src_addr, u8 proto) in ip_check_mc_rcu() argument
2725 mc_hash = rcu_dereference(in_dev->mc_hash); in ip_check_mc_rcu()
2736 for_each_pmc_rcu(in_dev, im) { in ip_check_mc_rcu()
2767 struct in_device *in_dev; member
2778 state->in_dev = NULL; in igmp_mc_get_first()
2780 struct in_device *in_dev; in igmp_mc_get_first() local
2782 in_dev = __in_dev_get_rcu(state->dev); in igmp_mc_get_first()
2783 if (!in_dev) in igmp_mc_get_first()
2785 im = rcu_dereference(in_dev->mc_list); in igmp_mc_get_first()
2787 state->in_dev = in_dev; in igmp_mc_get_first()
2802 state->in_dev = NULL; in igmp_mc_get_next()
2805 state->in_dev = __in_dev_get_rcu(state->dev); in igmp_mc_get_next()
2806 if (!state->in_dev) in igmp_mc_get_next()
2808 im = rcu_dereference(state->in_dev->mc_list); in igmp_mc_get_next()
2845 state->in_dev = NULL; in igmp_mc_seq_stop()
2862 querier = IGMP_V1_SEEN(state->in_dev) ? "V1" : in igmp_mc_seq_show()
2863 IGMP_V2_SEEN(state->in_dev) ? "V2" : in igmp_mc_seq_show()
2869 if (rcu_access_pointer(state->in_dev->mc_list) == im) { in igmp_mc_seq_show()
2871 state->dev->ifindex, state->dev->name, state->in_dev->mc_count, querier); in igmp_mc_seq_show()
3073 struct in_device *in_dev; in igmp_netdev_event() local
3077 in_dev = __in_dev_get_rtnl(dev); in igmp_netdev_event()
3078 if (in_dev) in igmp_netdev_event()
3079 ip_mc_rejoin_groups(in_dev); in igmp_netdev_event()