diff options
Diffstat (limited to 'net/ipv4/igmp.c')
-rw-r--r-- | net/ipv4/igmp.c | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c index 890c4258804c..4146153d875d 100644 --- a/net/ipv4/igmp.c +++ b/net/ipv4/igmp.c | |||
@@ -117,7 +117,7 @@ | |||
117 | #define IGMP_V2_Unsolicited_Report_Interval (10*HZ) | 117 | #define IGMP_V2_Unsolicited_Report_Interval (10*HZ) |
118 | #define IGMP_V3_Unsolicited_Report_Interval (1*HZ) | 118 | #define IGMP_V3_Unsolicited_Report_Interval (1*HZ) |
119 | #define IGMP_Query_Response_Interval (10*HZ) | 119 | #define IGMP_Query_Response_Interval (10*HZ) |
120 | #define IGMP_Unsolicited_Report_Count 2 | 120 | #define IGMP_Query_Robustness_Variable 2 |
121 | 121 | ||
122 | 122 | ||
123 | #define IGMP_Initial_Report_Delay (1) | 123 | #define IGMP_Initial_Report_Delay (1) |
@@ -756,8 +756,7 @@ static void igmp_ifc_event(struct in_device *in_dev) | |||
756 | { | 756 | { |
757 | if (IGMP_V1_SEEN(in_dev) || IGMP_V2_SEEN(in_dev)) | 757 | if (IGMP_V1_SEEN(in_dev) || IGMP_V2_SEEN(in_dev)) |
758 | return; | 758 | return; |
759 | in_dev->mr_ifc_count = in_dev->mr_qrv ? in_dev->mr_qrv : | 759 | in_dev->mr_ifc_count = in_dev->mr_qrv ?: sysctl_igmp_qrv; |
760 | IGMP_Unsolicited_Report_Count; | ||
761 | igmp_ifc_start_timer(in_dev, 1); | 760 | igmp_ifc_start_timer(in_dev, 1); |
762 | } | 761 | } |
763 | 762 | ||
@@ -1086,8 +1085,7 @@ static void igmpv3_add_delrec(struct in_device *in_dev, struct ip_mc_list *im) | |||
1086 | pmc->interface = im->interface; | 1085 | pmc->interface = im->interface; |
1087 | in_dev_hold(in_dev); | 1086 | in_dev_hold(in_dev); |
1088 | pmc->multiaddr = im->multiaddr; | 1087 | pmc->multiaddr = im->multiaddr; |
1089 | pmc->crcount = in_dev->mr_qrv ? in_dev->mr_qrv : | 1088 | pmc->crcount = in_dev->mr_qrv ?: sysctl_igmp_qrv; |
1090 | IGMP_Unsolicited_Report_Count; | ||
1091 | pmc->sfmode = im->sfmode; | 1089 | pmc->sfmode = im->sfmode; |
1092 | if (pmc->sfmode == MCAST_INCLUDE) { | 1090 | if (pmc->sfmode == MCAST_INCLUDE) { |
1093 | struct ip_sf_list *psf; | 1091 | struct ip_sf_list *psf; |
@@ -1226,8 +1224,7 @@ static void igmp_group_added(struct ip_mc_list *im) | |||
1226 | } | 1224 | } |
1227 | /* else, v3 */ | 1225 | /* else, v3 */ |
1228 | 1226 | ||
1229 | im->crcount = in_dev->mr_qrv ? in_dev->mr_qrv : | 1227 | im->crcount = in_dev->mr_qrv ?: sysctl_igmp_qrv; |
1230 | IGMP_Unsolicited_Report_Count; | ||
1231 | igmp_ifc_event(in_dev); | 1228 | igmp_ifc_event(in_dev); |
1232 | #endif | 1229 | #endif |
1233 | } | 1230 | } |
@@ -1322,7 +1319,7 @@ void ip_mc_inc_group(struct in_device *in_dev, __be32 addr) | |||
1322 | spin_lock_init(&im->lock); | 1319 | spin_lock_init(&im->lock); |
1323 | #ifdef CONFIG_IP_MULTICAST | 1320 | #ifdef CONFIG_IP_MULTICAST |
1324 | setup_timer(&im->timer, igmp_timer_expire, (unsigned long)im); | 1321 | setup_timer(&im->timer, igmp_timer_expire, (unsigned long)im); |
1325 | im->unsolicit_count = IGMP_Unsolicited_Report_Count; | 1322 | im->unsolicit_count = sysctl_igmp_qrv; |
1326 | #endif | 1323 | #endif |
1327 | 1324 | ||
1328 | im->next_rcu = in_dev->mc_list; | 1325 | im->next_rcu = in_dev->mc_list; |
@@ -1460,7 +1457,7 @@ void ip_mc_init_dev(struct in_device *in_dev) | |||
1460 | (unsigned long)in_dev); | 1457 | (unsigned long)in_dev); |
1461 | setup_timer(&in_dev->mr_ifc_timer, igmp_ifc_timer_expire, | 1458 | setup_timer(&in_dev->mr_ifc_timer, igmp_ifc_timer_expire, |
1462 | (unsigned long)in_dev); | 1459 | (unsigned long)in_dev); |
1463 | in_dev->mr_qrv = IGMP_Unsolicited_Report_Count; | 1460 | in_dev->mr_qrv = sysctl_igmp_qrv; |
1464 | #endif | 1461 | #endif |
1465 | 1462 | ||
1466 | spin_lock_init(&in_dev->mc_tomb_lock); | 1463 | spin_lock_init(&in_dev->mc_tomb_lock); |
@@ -1474,6 +1471,9 @@ void ip_mc_up(struct in_device *in_dev) | |||
1474 | 1471 | ||
1475 | ASSERT_RTNL(); | 1472 | ASSERT_RTNL(); |
1476 | 1473 | ||
1474 | #ifdef CONFIG_IP_MULTICAST | ||
1475 | in_dev->mr_qrv = sysctl_igmp_qrv; | ||
1476 | #endif | ||
1477 | ip_mc_inc_group(in_dev, IGMP_ALL_HOSTS); | 1477 | ip_mc_inc_group(in_dev, IGMP_ALL_HOSTS); |
1478 | 1478 | ||
1479 | for_each_pmc_rtnl(in_dev, pmc) | 1479 | for_each_pmc_rtnl(in_dev, pmc) |
@@ -1540,7 +1540,9 @@ static struct in_device *ip_mc_find_dev(struct net *net, struct ip_mreqn *imr) | |||
1540 | */ | 1540 | */ |
1541 | int sysctl_igmp_max_memberships __read_mostly = IP_MAX_MEMBERSHIPS; | 1541 | int sysctl_igmp_max_memberships __read_mostly = IP_MAX_MEMBERSHIPS; |
1542 | int sysctl_igmp_max_msf __read_mostly = IP_MAX_MSF; | 1542 | int sysctl_igmp_max_msf __read_mostly = IP_MAX_MSF; |
1543 | 1543 | #ifdef CONFIG_IP_MULTICAST | |
1544 | int sysctl_igmp_qrv __read_mostly = IGMP_Query_Robustness_Variable; | ||
1545 | #endif | ||
1544 | 1546 | ||
1545 | static int ip_mc_del1_src(struct ip_mc_list *pmc, int sfmode, | 1547 | static int ip_mc_del1_src(struct ip_mc_list *pmc, int sfmode, |
1546 | __be32 *psfsrc) | 1548 | __be32 *psfsrc) |
@@ -1575,8 +1577,7 @@ static int ip_mc_del1_src(struct ip_mc_list *pmc, int sfmode, | |||
1575 | #ifdef CONFIG_IP_MULTICAST | 1577 | #ifdef CONFIG_IP_MULTICAST |
1576 | if (psf->sf_oldin && | 1578 | if (psf->sf_oldin && |
1577 | !IGMP_V1_SEEN(in_dev) && !IGMP_V2_SEEN(in_dev)) { | 1579 | !IGMP_V1_SEEN(in_dev) && !IGMP_V2_SEEN(in_dev)) { |
1578 | psf->sf_crcount = in_dev->mr_qrv ? in_dev->mr_qrv : | 1580 | psf->sf_crcount = in_dev->mr_qrv ?: sysctl_igmp_qrv; |
1579 | IGMP_Unsolicited_Report_Count; | ||
1580 | psf->sf_next = pmc->tomb; | 1581 | psf->sf_next = pmc->tomb; |
1581 | pmc->tomb = psf; | 1582 | pmc->tomb = psf; |
1582 | rv = 1; | 1583 | rv = 1; |
@@ -1639,8 +1640,7 @@ static int ip_mc_del_src(struct in_device *in_dev, __be32 *pmca, int sfmode, | |||
1639 | /* filter mode change */ | 1640 | /* filter mode change */ |
1640 | pmc->sfmode = MCAST_INCLUDE; | 1641 | pmc->sfmode = MCAST_INCLUDE; |
1641 | #ifdef CONFIG_IP_MULTICAST | 1642 | #ifdef CONFIG_IP_MULTICAST |
1642 | pmc->crcount = in_dev->mr_qrv ? in_dev->mr_qrv : | 1643 | pmc->crcount = in_dev->mr_qrv ?: sysctl_igmp_qrv; |
1643 | IGMP_Unsolicited_Report_Count; | ||
1644 | in_dev->mr_ifc_count = pmc->crcount; | 1644 | in_dev->mr_ifc_count = pmc->crcount; |
1645 | for (psf = pmc->sources; psf; psf = psf->sf_next) | 1645 | for (psf = pmc->sources; psf; psf = psf->sf_next) |
1646 | psf->sf_crcount = 0; | 1646 | psf->sf_crcount = 0; |
@@ -1818,8 +1818,7 @@ static int ip_mc_add_src(struct in_device *in_dev, __be32 *pmca, int sfmode, | |||
1818 | #ifdef CONFIG_IP_MULTICAST | 1818 | #ifdef CONFIG_IP_MULTICAST |
1819 | /* else no filters; keep old mode for reports */ | 1819 | /* else no filters; keep old mode for reports */ |
1820 | 1820 | ||
1821 | pmc->crcount = in_dev->mr_qrv ? in_dev->mr_qrv : | 1821 | pmc->crcount = in_dev->mr_qrv ?: sysctl_igmp_qrv; |
1822 | IGMP_Unsolicited_Report_Count; | ||
1823 | in_dev->mr_ifc_count = pmc->crcount; | 1822 | in_dev->mr_ifc_count = pmc->crcount; |
1824 | for (psf = pmc->sources; psf; psf = psf->sf_next) | 1823 | for (psf = pmc->sources; psf; psf = psf->sf_next) |
1825 | psf->sf_crcount = 0; | 1824 | psf->sf_crcount = 0; |