igmp.c (9f30a04d768f64280dc0c40b730746e82f298d88) igmp.c (e2cb77db089796f163092326ca25512845df7a3a)
1/*
2 * Linux NET3: Internet Group Management Protocol [IGMP]
3 *
4 * This code implements the IGMP protocol as defined in RFC1112. There has
5 * been a further revision of this protocol since which is now supported.
6 *
7 * If you have trouble with this module be careful what gcc you have used,
8 * the older version didn't come out right using gcc 2.5.8, the newer one

--- 383 unchanged lines hidden (view full) ---

392
393static int igmpv3_sendpack(struct sk_buff *skb)
394{
395 struct igmphdr *pig = igmp_hdr(skb);
396 const int igmplen = skb_tail_pointer(skb) - skb_transport_header(skb);
397
398 pig->csum = ip_compute_csum(igmp_hdr(skb), igmplen);
399
1/*
2 * Linux NET3: Internet Group Management Protocol [IGMP]
3 *
4 * This code implements the IGMP protocol as defined in RFC1112. There has
5 * been a further revision of this protocol since which is now supported.
6 *
7 * If you have trouble with this module be careful what gcc you have used,
8 * the older version didn't come out right using gcc 2.5.8, the newer one

--- 383 unchanged lines hidden (view full) ---

392
393static int igmpv3_sendpack(struct sk_buff *skb)
394{
395 struct igmphdr *pig = igmp_hdr(skb);
396 const int igmplen = skb_tail_pointer(skb) - skb_transport_header(skb);
397
398 pig->csum = ip_compute_csum(igmp_hdr(skb), igmplen);
399
400 return ip_local_out(skb);
400 return ip_local_out(skb->sk, skb);
401}
402
403static int grec_size(struct ip_mc_list *pmc, int type, int gdel, int sdel)
404{
405 return sizeof(struct igmpv3_grec) + 4*igmp_scount(pmc, type, gdel, sdel);
406}
407
408static struct sk_buff *add_grhead(struct sk_buff *skb, struct ip_mc_list *pmc,

--- 325 unchanged lines hidden (view full) ---

734
735 ih = (struct igmphdr *)skb_put(skb, sizeof(struct igmphdr));
736 ih->type = type;
737 ih->code = 0;
738 ih->csum = 0;
739 ih->group = group;
740 ih->csum = ip_compute_csum((void *)ih, sizeof(struct igmphdr));
741
401}
402
403static int grec_size(struct ip_mc_list *pmc, int type, int gdel, int sdel)
404{
405 return sizeof(struct igmpv3_grec) + 4*igmp_scount(pmc, type, gdel, sdel);
406}
407
408static struct sk_buff *add_grhead(struct sk_buff *skb, struct ip_mc_list *pmc,

--- 325 unchanged lines hidden (view full) ---

734
735 ih = (struct igmphdr *)skb_put(skb, sizeof(struct igmphdr));
736 ih->type = type;
737 ih->code = 0;
738 ih->csum = 0;
739 ih->group = group;
740 ih->csum = ip_compute_csum((void *)ih, sizeof(struct igmphdr));
741
742 return ip_local_out(skb);
742 return ip_local_out(skb->sk, skb);
743}
744
745static void igmp_gq_timer_expire(unsigned long data)
746{
747 struct in_device *in_dev = (struct in_device *)data;
748
749 in_dev->mr_gq_running = 0;
750 igmpv3_send_report(in_dev, NULL);

--- 1813 unchanged lines hidden (view full) ---

2564 /* decrease mem now to avoid the memleak warning */
2565 atomic_sub(sizeof(*iml), &sk->sk_omem_alloc);
2566 kfree_rcu(iml, rcu);
2567 }
2568 rtnl_unlock();
2569}
2570
2571/* called with rcu_read_lock() */
743}
744
745static void igmp_gq_timer_expire(unsigned long data)
746{
747 struct in_device *in_dev = (struct in_device *)data;
748
749 in_dev->mr_gq_running = 0;
750 igmpv3_send_report(in_dev, NULL);

--- 1813 unchanged lines hidden (view full) ---

2564 /* decrease mem now to avoid the memleak warning */
2565 atomic_sub(sizeof(*iml), &sk->sk_omem_alloc);
2566 kfree_rcu(iml, rcu);
2567 }
2568 rtnl_unlock();
2569}
2570
2571/* called with rcu_read_lock() */
2572int ip_check_mc_rcu(struct in_device *in_dev, __be32 mc_addr, __be32 src_addr, u16 proto)
2572int ip_check_mc_rcu(struct in_device *in_dev, __be32 mc_addr, __be32 src_addr, u8 proto)
2573{
2574 struct ip_mc_list *im;
2575 struct ip_mc_list __rcu **mc_hash;
2576 struct ip_sf_list *psf;
2577 int rv = 0;
2578
2579 mc_hash = rcu_dereference(in_dev->mc_hash);
2580 if (mc_hash) {

--- 409 unchanged lines hidden ---
2573{
2574 struct ip_mc_list *im;
2575 struct ip_mc_list __rcu **mc_hash;
2576 struct ip_sf_list *psf;
2577 int rv = 0;
2578
2579 mc_hash = rcu_dereference(in_dev->mc_hash);
2580 if (mc_hash) {

--- 409 unchanged lines hidden ---