]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - net/ipv4/igmp.c
net: use the macros defined for the members of flowi
[net-next-2.6.git] / net / ipv4 / igmp.c
index 6f49d6c087da87ebcc8f808c8daef2aedaab4fd1..afb1e82a59f9acea63d1037f0ca5414cb8df58bf 100644 (file)
@@ -163,6 +163,16 @@ static void ip_ma_put(struct ip_mc_list *im)
        }
 }
 
+#define for_each_pmc_rcu(in_dev, pmc)                          \
+       for (pmc = rcu_dereference(in_dev->mc_list);            \
+            pmc != NULL;                                       \
+            pmc = rcu_dereference(pmc->next_rcu))
+
+#define for_each_pmc_rtnl(in_dev, pmc)                         \
+       for (pmc = rtnl_dereference(in_dev->mc_list);           \
+            pmc != NULL;                                       \
+            pmc = rtnl_dereference(pmc->next_rcu))
+
 #ifdef CONFIG_IP_MULTICAST
 
 /*
@@ -304,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);
@@ -502,16 +511,6 @@ empty_source:
        return skb;
 }
 
-#define for_each_pmc_rcu(in_dev, pmc)                          \
-       for (pmc = rcu_dereference(in_dev->mc_list);            \
-            pmc != NULL;                                       \
-            pmc = rcu_dereference(pmc->next_rcu))
-
-#define for_each_pmc_rtnl(in_dev, pmc)                         \
-       for (pmc = rtnl_dereference(in_dev->mc_list);           \
-            pmc != NULL;                                       \
-            pmc = rtnl_dereference(pmc->next_rcu))
-
 static int igmpv3_send_report(struct in_device *in_dev, struct ip_mc_list *pmc)
 {
        struct sk_buff *skb = NULL;
@@ -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;
@@ -1425,8 +1424,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;
@@ -2307,10 +2305,8 @@ void ip_mc_drop_socket(struct sock *sk)
                inet->mc_list = iml->next_rcu;
                in_dev = inetdev_by_index(net, iml->multi.imr_ifindex);
                (void) ip_mc_leave_src(sk, iml, in_dev);
-               if (in_dev != NULL) {
+               if (in_dev != NULL)
                        ip_mc_dec_group(in_dev, iml->multi.imr_multiaddr.s_addr);
-                       in_dev_put(in_dev);
-               }
                /* decrease mem now to avoid the memleak warning */
                atomic_sub(sizeof(*iml), &sk->sk_omem_alloc);
                call_rcu(&iml->rcu, ip_mc_socklist_reclaim);