aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/igmp.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv4/igmp.c')
-rw-r--r--net/ipv4/igmp.c46
1 files changed, 23 insertions, 23 deletions
diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c
index 024ae56cab25..b8e1625d34cf 100644
--- a/net/ipv4/igmp.c
+++ b/net/ipv4/igmp.c
@@ -35,7 +35,7 @@
35 * 35 *
36 * Chih-Jen Chang : Tried to revise IGMP to Version 2 36 * Chih-Jen Chang : Tried to revise IGMP to Version 2
37 * Tsu-Sheng Tsao E-mail: chihjenc@scf.usc.edu and tsusheng@scf.usc.edu 37 * Tsu-Sheng Tsao E-mail: chihjenc@scf.usc.edu and tsusheng@scf.usc.edu
38 * The enhancements are mainly based on Steve Deering's 38 * The enhancements are mainly based on Steve Deering's
39 * ipmulti-3.5 source code. 39 * ipmulti-3.5 source code.
40 * Chih-Jen Chang : Added the igmp_get_mrouter_info and 40 * Chih-Jen Chang : Added the igmp_get_mrouter_info and
41 * Tsu-Sheng Tsao igmp_set_mrouter_info to keep track of 41 * Tsu-Sheng Tsao igmp_set_mrouter_info to keep track of
@@ -49,11 +49,11 @@
49 * Alan Cox : Stop IGMP from 0.0.0.0 being accepted. 49 * Alan Cox : Stop IGMP from 0.0.0.0 being accepted.
50 * Alan Cox : Use GFP_ATOMIC in the right places. 50 * Alan Cox : Use GFP_ATOMIC in the right places.
51 * Christian Daudt : igmp timer wasn't set for local group 51 * Christian Daudt : igmp timer wasn't set for local group
52 * memberships but was being deleted, 52 * memberships but was being deleted,
53 * which caused a "del_timer() called 53 * which caused a "del_timer() called
54 * from %p with timer not initialized\n" 54 * from %p with timer not initialized\n"
55 * message (960131). 55 * message (960131).
56 * Christian Daudt : removed del_timer from 56 * Christian Daudt : removed del_timer from
57 * igmp_timer_expire function (960205). 57 * igmp_timer_expire function (960205).
58 * Christian Daudt : igmp_heard_report now only calls 58 * Christian Daudt : igmp_heard_report now only calls
59 * igmp_timer_expire if tm->running is 59 * igmp_timer_expire if tm->running is
@@ -718,7 +718,7 @@ static void igmp_ifc_event(struct in_device *in_dev)
718{ 718{
719 if (IGMP_V1_SEEN(in_dev) || IGMP_V2_SEEN(in_dev)) 719 if (IGMP_V1_SEEN(in_dev) || IGMP_V2_SEEN(in_dev))
720 return; 720 return;
721 in_dev->mr_ifc_count = in_dev->mr_qrv ? in_dev->mr_qrv : 721 in_dev->mr_ifc_count = in_dev->mr_qrv ? in_dev->mr_qrv :
722 IGMP_Unsolicited_Report_Count; 722 IGMP_Unsolicited_Report_Count;
723 igmp_ifc_start_timer(in_dev, 1); 723 igmp_ifc_start_timer(in_dev, 1);
724} 724}
@@ -838,7 +838,7 @@ static void igmp_heard_query(struct in_device *in_dev, struct sk_buff *skb,
838 if (len == 8) { 838 if (len == 8) {
839 if (ih->code == 0) { 839 if (ih->code == 0) {
840 /* Alas, old v1 router presents here. */ 840 /* Alas, old v1 router presents here. */
841 841
842 max_delay = IGMP_Query_Response_Interval; 842 max_delay = IGMP_Query_Response_Interval;
843 in_dev->mr_v1_seen = jiffies + 843 in_dev->mr_v1_seen = jiffies +
844 IGMP_V1_Router_Present_Timeout; 844 IGMP_V1_Router_Present_Timeout;
@@ -860,10 +860,10 @@ static void igmp_heard_query(struct in_device *in_dev, struct sk_buff *skb,
860 } else { /* v3 */ 860 } else { /* v3 */
861 if (!pskb_may_pull(skb, sizeof(struct igmpv3_query))) 861 if (!pskb_may_pull(skb, sizeof(struct igmpv3_query)))
862 return; 862 return;
863 863
864 ih3 = (struct igmpv3_query *) skb->h.raw; 864 ih3 = (struct igmpv3_query *) skb->h.raw;
865 if (ih3->nsrcs) { 865 if (ih3->nsrcs) {
866 if (!pskb_may_pull(skb, sizeof(struct igmpv3_query) 866 if (!pskb_may_pull(skb, sizeof(struct igmpv3_query)
867 + ntohs(ih3->nsrcs)*sizeof(__be32))) 867 + ntohs(ih3->nsrcs)*sizeof(__be32)))
868 return; 868 return;
869 ih3 = (struct igmpv3_query *) skb->h.raw; 869 ih3 = (struct igmpv3_query *) skb->h.raw;
@@ -909,7 +909,7 @@ static void igmp_heard_query(struct in_device *in_dev, struct sk_buff *skb,
909 else 909 else
910 im->gsquery = mark; 910 im->gsquery = mark;
911 changed = !im->gsquery || 911 changed = !im->gsquery ||
912 igmp_marksources(im, ntohs(ih3->nsrcs), ih3->srcs); 912 igmp_marksources(im, ntohs(ih3->nsrcs), ih3->srcs);
913 spin_unlock_bh(&im->lock); 913 spin_unlock_bh(&im->lock);
914 if (changed) 914 if (changed)
915 igmp_mod_timer(im, max_delay); 915 igmp_mod_timer(im, max_delay);
@@ -1257,9 +1257,9 @@ out:
1257void ip_mc_dec_group(struct in_device *in_dev, __be32 addr) 1257void ip_mc_dec_group(struct in_device *in_dev, __be32 addr)
1258{ 1258{
1259 struct ip_mc_list *i, **ip; 1259 struct ip_mc_list *i, **ip;
1260 1260
1261 ASSERT_RTNL(); 1261 ASSERT_RTNL();
1262 1262
1263 for (ip=&in_dev->mc_list; (i=*ip)!=NULL; ip=&i->next) { 1263 for (ip=&in_dev->mc_list; (i=*ip)!=NULL; ip=&i->next) {
1264 if (i->multiaddr==addr) { 1264 if (i->multiaddr==addr) {
1265 if (--i->users == 0) { 1265 if (--i->users == 0) {
@@ -1436,7 +1436,7 @@ static int ip_mc_del1_src(struct ip_mc_list *pmc, int sfmode,
1436#ifdef CONFIG_IP_MULTICAST 1436#ifdef CONFIG_IP_MULTICAST
1437 if (psf->sf_oldin && 1437 if (psf->sf_oldin &&
1438 !IGMP_V1_SEEN(in_dev) && !IGMP_V2_SEEN(in_dev)) { 1438 !IGMP_V1_SEEN(in_dev) && !IGMP_V2_SEEN(in_dev)) {
1439 psf->sf_crcount = in_dev->mr_qrv ? in_dev->mr_qrv : 1439 psf->sf_crcount = in_dev->mr_qrv ? in_dev->mr_qrv :
1440 IGMP_Unsolicited_Report_Count; 1440 IGMP_Unsolicited_Report_Count;
1441 psf->sf_next = pmc->tomb; 1441 psf->sf_next = pmc->tomb;
1442 pmc->tomb = psf; 1442 pmc->tomb = psf;
@@ -1500,7 +1500,7 @@ static int ip_mc_del_src(struct in_device *in_dev, __be32 *pmca, int sfmode,
1500 /* filter mode change */ 1500 /* filter mode change */
1501 pmc->sfmode = MCAST_INCLUDE; 1501 pmc->sfmode = MCAST_INCLUDE;
1502#ifdef CONFIG_IP_MULTICAST 1502#ifdef CONFIG_IP_MULTICAST
1503 pmc->crcount = in_dev->mr_qrv ? in_dev->mr_qrv : 1503 pmc->crcount = in_dev->mr_qrv ? in_dev->mr_qrv :
1504 IGMP_Unsolicited_Report_Count; 1504 IGMP_Unsolicited_Report_Count;
1505 in_dev->mr_ifc_count = pmc->crcount; 1505 in_dev->mr_ifc_count = pmc->crcount;
1506 for (psf=pmc->sources; psf; psf = psf->sf_next) 1506 for (psf=pmc->sources; psf; psf = psf->sf_next)
@@ -1679,7 +1679,7 @@ static int ip_mc_add_src(struct in_device *in_dev, __be32 *pmca, int sfmode,
1679#ifdef CONFIG_IP_MULTICAST 1679#ifdef CONFIG_IP_MULTICAST
1680 /* else no filters; keep old mode for reports */ 1680 /* else no filters; keep old mode for reports */
1681 1681
1682 pmc->crcount = in_dev->mr_qrv ? in_dev->mr_qrv : 1682 pmc->crcount = in_dev->mr_qrv ? in_dev->mr_qrv :
1683 IGMP_Unsolicited_Report_Count; 1683 IGMP_Unsolicited_Report_Count;
1684 in_dev->mr_ifc_count = pmc->crcount; 1684 in_dev->mr_ifc_count = pmc->crcount;
1685 for (psf=pmc->sources; psf; psf = psf->sf_next) 1685 for (psf=pmc->sources; psf; psf = psf->sf_next)
@@ -1873,7 +1873,7 @@ int ip_mc_source(int add, int omode, struct sock *sk, struct
1873 } else if (pmc->sfmode != omode) { 1873 } else if (pmc->sfmode != omode) {
1874 /* allow mode switches for empty-set filters */ 1874 /* allow mode switches for empty-set filters */
1875 ip_mc_add_src(in_dev, &mreqs->imr_multiaddr, omode, 0, NULL, 0); 1875 ip_mc_add_src(in_dev, &mreqs->imr_multiaddr, omode, 0, NULL, 0);
1876 ip_mc_del_src(in_dev, &mreqs->imr_multiaddr, pmc->sfmode, 0, 1876 ip_mc_del_src(in_dev, &mreqs->imr_multiaddr, pmc->sfmode, 0,
1877 NULL, 0); 1877 NULL, 0);
1878 pmc->sfmode = omode; 1878 pmc->sfmode = omode;
1879 } 1879 }
@@ -1899,7 +1899,7 @@ int ip_mc_source(int add, int omode, struct sock *sk, struct
1899 } 1899 }
1900 1900
1901 /* update the interface filter */ 1901 /* update the interface filter */
1902 ip_mc_del_src(in_dev, &mreqs->imr_multiaddr, omode, 1, 1902 ip_mc_del_src(in_dev, &mreqs->imr_multiaddr, omode, 1,
1903 &mreqs->imr_sourceaddr, 1); 1903 &mreqs->imr_sourceaddr, 1);
1904 1904
1905 for (j=i+1; j<psl->sl_count; j++) 1905 for (j=i+1; j<psl->sl_count; j++)
@@ -1949,7 +1949,7 @@ int ip_mc_source(int add, int omode, struct sock *sk, struct
1949 psl->sl_count++; 1949 psl->sl_count++;
1950 err = 0; 1950 err = 0;
1951 /* update the interface list */ 1951 /* update the interface list */
1952 ip_mc_add_src(in_dev, &mreqs->imr_multiaddr, omode, 1, 1952 ip_mc_add_src(in_dev, &mreqs->imr_multiaddr, omode, 1,
1953 &mreqs->imr_sourceaddr, 1); 1953 &mreqs->imr_sourceaddr, 1);
1954done: 1954done:
1955 rtnl_unlock(); 1955 rtnl_unlock();
@@ -2264,7 +2264,7 @@ static inline struct ip_mc_list *igmp_mc_get_first(struct seq_file *seq)
2264 struct igmp_mc_iter_state *state = igmp_mc_seq_private(seq); 2264 struct igmp_mc_iter_state *state = igmp_mc_seq_private(seq);
2265 2265
2266 for (state->dev = dev_base, state->in_dev = NULL; 2266 for (state->dev = dev_base, state->in_dev = NULL;
2267 state->dev; 2267 state->dev;
2268 state->dev = state->dev->next) { 2268 state->dev = state->dev->next) {
2269 struct in_device *in_dev; 2269 struct in_device *in_dev;
2270 in_dev = in_dev_get(state->dev); 2270 in_dev = in_dev_get(state->dev);
@@ -2346,7 +2346,7 @@ static void igmp_mc_seq_stop(struct seq_file *seq, void *v)
2346static int igmp_mc_seq_show(struct seq_file *seq, void *v) 2346static int igmp_mc_seq_show(struct seq_file *seq, void *v)
2347{ 2347{
2348 if (v == SEQ_START_TOKEN) 2348 if (v == SEQ_START_TOKEN)
2349 seq_puts(seq, 2349 seq_puts(seq,
2350 "Idx\tDevice : Count Querier\tGroup Users Timer\tReporter\n"); 2350 "Idx\tDevice : Count Querier\tGroup Users Timer\tReporter\n");
2351 else { 2351 else {
2352 struct ip_mc_list *im = (struct ip_mc_list *)v; 2352 struct ip_mc_list *im = (struct ip_mc_list *)v;
@@ -2426,7 +2426,7 @@ static inline struct ip_sf_list *igmp_mcf_get_first(struct seq_file *seq)
2426 struct igmp_mcf_iter_state *state = igmp_mcf_seq_private(seq); 2426 struct igmp_mcf_iter_state *state = igmp_mcf_seq_private(seq);
2427 2427
2428 for (state->dev = dev_base, state->idev = NULL, state->im = NULL; 2428 for (state->dev = dev_base, state->idev = NULL, state->im = NULL;
2429 state->dev; 2429 state->dev;
2430 state->dev = state->dev->next) { 2430 state->dev = state->dev->next) {
2431 struct in_device *idev; 2431 struct in_device *idev;
2432 idev = in_dev_get(state->dev); 2432 idev = in_dev_get(state->dev);
@@ -2531,7 +2531,7 @@ static int igmp_mcf_seq_show(struct seq_file *seq, void *v)
2531 struct igmp_mcf_iter_state *state = igmp_mcf_seq_private(seq); 2531 struct igmp_mcf_iter_state *state = igmp_mcf_seq_private(seq);
2532 2532
2533 if (v == SEQ_START_TOKEN) { 2533 if (v == SEQ_START_TOKEN) {
2534 seq_printf(seq, 2534 seq_printf(seq,
2535 "%3s %6s " 2535 "%3s %6s "
2536 "%10s %10s %6s %6s\n", "Idx", 2536 "%10s %10s %6s %6s\n", "Idx",
2537 "Device", "MCA", 2537 "Device", "MCA",
@@ -2539,8 +2539,8 @@ static int igmp_mcf_seq_show(struct seq_file *seq, void *v)
2539 } else { 2539 } else {
2540 seq_printf(seq, 2540 seq_printf(seq,
2541 "%3d %6.6s 0x%08x " 2541 "%3d %6.6s 0x%08x "
2542 "0x%08x %6lu %6lu\n", 2542 "0x%08x %6lu %6lu\n",
2543 state->dev->ifindex, state->dev->name, 2543 state->dev->ifindex, state->dev->name,
2544 ntohl(state->im->multiaddr), 2544 ntohl(state->im->multiaddr),
2545 ntohl(psf->sf_inaddr), 2545 ntohl(psf->sf_inaddr),
2546 psf->sf_count[MCAST_INCLUDE], 2546 psf->sf_count[MCAST_INCLUDE],