]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - net/ipv4/igmp.c
bonding: IGMP handling cleanup
[net-next-2.6.git] / net / ipv4 / igmp.c
index a1bf2f49e71662251f2303a61cdb007c5ffee49c..50f6bc1a002acc7324dd46586d5698fed1090b62 100644 (file)
@@ -314,8 +314,7 @@ static struct sk_buff *igmpv3_newpack(struct net_device *dev, int size)
 
        {
                struct flowi fl = { .oif = dev->ifindex,
-                                   .nl_u = { .ip4_u = {
-                                   .daddr = IGMPV3_ALL_MCR } },
+                                   .fl4_dst = IGMPV3_ALL_MCR,
                                    .proto = IPPROTO_IGMP };
                if (ip_route_output_key(net, &rt, &fl)) {
                        kfree_skb(skb);
@@ -660,7 +659,7 @@ static int igmp_send_report(struct in_device *in_dev, struct ip_mc_list *pmc,
 
        {
                struct flowi fl = { .oif = dev->ifindex,
-                                   .nl_u = { .ip4_u = { .daddr = dst } },
+                                   .fl4_dst = dst,
                                    .proto = IPPROTO_IGMP };
                if (ip_route_output_key(net, &rt, &fl))
                        return -1;
@@ -1268,26 +1267,32 @@ EXPORT_SYMBOL(ip_mc_inc_group);
 
 /*
  *     Resend IGMP JOIN report; used for bonding.
+ *     Called with rcu_read_lock()
  */
-void ip_mc_rejoin_group(struct ip_mc_list *im)
+void ip_mc_rejoin_groups(struct in_device *in_dev)
 {
 #ifdef CONFIG_IP_MULTICAST
-       struct in_device *in_dev = im->interface;
+       struct ip_mc_list *im;
+       int type;
 
-       if (im->multiaddr == IGMP_ALL_HOSTS)
-               return;
+       for_each_pmc_rcu(in_dev, im) {
+               if (im->multiaddr == IGMP_ALL_HOSTS)
+                       continue;
 
-       /* a failover is happening and switches
-        * must be notified immediately */
-       if (IGMP_V1_SEEN(in_dev))
-               igmp_send_report(in_dev, im, IGMP_HOST_MEMBERSHIP_REPORT);
-       else if (IGMP_V2_SEEN(in_dev))
-               igmp_send_report(in_dev, im, IGMPV2_HOST_MEMBERSHIP_REPORT);
-       else
-               igmp_send_report(in_dev, im, IGMPV3_HOST_MEMBERSHIP_REPORT);
+               /* a failover is happening and switches
+                * must be notified immediately
+                */
+               if (IGMP_V1_SEEN(in_dev))
+                       type = IGMP_HOST_MEMBERSHIP_REPORT;
+               else if (IGMP_V2_SEEN(in_dev))
+                       type = IGMPV2_HOST_MEMBERSHIP_REPORT;
+               else
+                       type = IGMPV3_HOST_MEMBERSHIP_REPORT;
+               igmp_send_report(in_dev, im, type);
+       }
 #endif
 }
-EXPORT_SYMBOL(ip_mc_rejoin_group);
+EXPORT_SYMBOL(ip_mc_rejoin_groups);
 
 /*
  *     A socket has left a multicast group on device dev
@@ -1425,8 +1430,7 @@ void ip_mc_destroy_dev(struct in_device *in_dev)
 /* RTNL is locked */
 static struct in_device *ip_mc_find_dev(struct net *net, struct ip_mreqn *imr)
 {
-       struct flowi fl = { .nl_u = { .ip4_u =
-                                     { .daddr = imr->imr_multiaddr.s_addr } } };
+       struct flowi fl = { .fl4_dst = imr->imr_multiaddr.s_addr };
        struct rtable *rt;
        struct net_device *dev = NULL;
        struct in_device *idev = NULL;