|
@@ -110,6 +110,9 @@
|
|
#define IP_MAX_MEMBERSHIPS 20
|
|
#define IP_MAX_MEMBERSHIPS 20
|
|
#define IP_MAX_MSF 10
|
|
#define IP_MAX_MSF 10
|
|
|
|
|
|
|
|
+/* IGMP reports for link-local multicast groups are enabled by default */
|
|
|
|
+int sysctl_igmp_llm_reports __read_mostly = 1;
|
|
|
|
+
|
|
#ifdef CONFIG_IP_MULTICAST
|
|
#ifdef CONFIG_IP_MULTICAST
|
|
/* Parameter names and values are taken from igmp-v2-06 draft */
|
|
/* Parameter names and values are taken from igmp-v2-06 draft */
|
|
|
|
|
|
@@ -437,6 +440,8 @@ static struct sk_buff *add_grec(struct sk_buff *skb, struct ip_mc_list *pmc,
|
|
|
|
|
|
if (pmc->multiaddr == IGMP_ALL_HOSTS)
|
|
if (pmc->multiaddr == IGMP_ALL_HOSTS)
|
|
return skb;
|
|
return skb;
|
|
|
|
+ if (ipv4_is_local_multicast(pmc->multiaddr) && !sysctl_igmp_llm_reports)
|
|
|
|
+ return skb;
|
|
|
|
|
|
isquery = type == IGMPV3_MODE_IS_INCLUDE ||
|
|
isquery = type == IGMPV3_MODE_IS_INCLUDE ||
|
|
type == IGMPV3_MODE_IS_EXCLUDE;
|
|
type == IGMPV3_MODE_IS_EXCLUDE;
|
|
@@ -545,6 +550,9 @@ static int igmpv3_send_report(struct in_device *in_dev, struct ip_mc_list *pmc)
|
|
for_each_pmc_rcu(in_dev, pmc) {
|
|
for_each_pmc_rcu(in_dev, pmc) {
|
|
if (pmc->multiaddr == IGMP_ALL_HOSTS)
|
|
if (pmc->multiaddr == IGMP_ALL_HOSTS)
|
|
continue;
|
|
continue;
|
|
|
|
+ if (ipv4_is_local_multicast(pmc->multiaddr) &&
|
|
|
|
+ !sysctl_igmp_llm_reports)
|
|
|
|
+ continue;
|
|
spin_lock_bh(&pmc->lock);
|
|
spin_lock_bh(&pmc->lock);
|
|
if (pmc->sfcount[MCAST_EXCLUDE])
|
|
if (pmc->sfcount[MCAST_EXCLUDE])
|
|
type = IGMPV3_MODE_IS_EXCLUDE;
|
|
type = IGMPV3_MODE_IS_EXCLUDE;
|
|
@@ -678,7 +686,11 @@ static int igmp_send_report(struct in_device *in_dev, struct ip_mc_list *pmc,
|
|
|
|
|
|
if (type == IGMPV3_HOST_MEMBERSHIP_REPORT)
|
|
if (type == IGMPV3_HOST_MEMBERSHIP_REPORT)
|
|
return igmpv3_send_report(in_dev, pmc);
|
|
return igmpv3_send_report(in_dev, pmc);
|
|
- else if (type == IGMP_HOST_LEAVE_MESSAGE)
|
|
|
|
|
|
+
|
|
|
|
+ if (ipv4_is_local_multicast(group) && !sysctl_igmp_llm_reports)
|
|
|
|
+ return 0;
|
|
|
|
+
|
|
|
|
+ if (type == IGMP_HOST_LEAVE_MESSAGE)
|
|
dst = IGMP_ALL_ROUTER;
|
|
dst = IGMP_ALL_ROUTER;
|
|
else
|
|
else
|
|
dst = group;
|
|
dst = group;
|
|
@@ -851,6 +863,8 @@ static bool igmp_heard_report(struct in_device *in_dev, __be32 group)
|
|
|
|
|
|
if (group == IGMP_ALL_HOSTS)
|
|
if (group == IGMP_ALL_HOSTS)
|
|
return false;
|
|
return false;
|
|
|
|
+ if (ipv4_is_local_multicast(group) && !sysctl_igmp_llm_reports)
|
|
|
|
+ return false;
|
|
|
|
|
|
rcu_read_lock();
|
|
rcu_read_lock();
|
|
for_each_pmc_rcu(in_dev, im) {
|
|
for_each_pmc_rcu(in_dev, im) {
|
|
@@ -957,6 +971,9 @@ static bool igmp_heard_query(struct in_device *in_dev, struct sk_buff *skb,
|
|
continue;
|
|
continue;
|
|
if (im->multiaddr == IGMP_ALL_HOSTS)
|
|
if (im->multiaddr == IGMP_ALL_HOSTS)
|
|
continue;
|
|
continue;
|
|
|
|
+ if (ipv4_is_local_multicast(im->multiaddr) &&
|
|
|
|
+ !sysctl_igmp_llm_reports)
|
|
|
|
+ continue;
|
|
spin_lock_bh(&im->lock);
|
|
spin_lock_bh(&im->lock);
|
|
if (im->tm_running)
|
|
if (im->tm_running)
|
|
im->gsquery = im->gsquery && mark;
|
|
im->gsquery = im->gsquery && mark;
|
|
@@ -1181,6 +1198,8 @@ static void igmp_group_dropped(struct ip_mc_list *im)
|
|
#ifdef CONFIG_IP_MULTICAST
|
|
#ifdef CONFIG_IP_MULTICAST
|
|
if (im->multiaddr == IGMP_ALL_HOSTS)
|
|
if (im->multiaddr == IGMP_ALL_HOSTS)
|
|
return;
|
|
return;
|
|
|
|
+ if (ipv4_is_local_multicast(im->multiaddr) && !sysctl_igmp_llm_reports)
|
|
|
|
+ return;
|
|
|
|
|
|
reporter = im->reporter;
|
|
reporter = im->reporter;
|
|
igmp_stop_timer(im);
|
|
igmp_stop_timer(im);
|
|
@@ -1213,6 +1232,8 @@ static void igmp_group_added(struct ip_mc_list *im)
|
|
#ifdef CONFIG_IP_MULTICAST
|
|
#ifdef CONFIG_IP_MULTICAST
|
|
if (im->multiaddr == IGMP_ALL_HOSTS)
|
|
if (im->multiaddr == IGMP_ALL_HOSTS)
|
|
return;
|
|
return;
|
|
|
|
+ if (ipv4_is_local_multicast(im->multiaddr) && !sysctl_igmp_llm_reports)
|
|
|
|
+ return;
|
|
|
|
|
|
if (in_dev->dead)
|
|
if (in_dev->dead)
|
|
return;
|
|
return;
|
|
@@ -1518,6 +1539,9 @@ static void ip_mc_rejoin_groups(struct in_device *in_dev)
|
|
for_each_pmc_rtnl(in_dev, im) {
|
|
for_each_pmc_rtnl(in_dev, im) {
|
|
if (im->multiaddr == IGMP_ALL_HOSTS)
|
|
if (im->multiaddr == IGMP_ALL_HOSTS)
|
|
continue;
|
|
continue;
|
|
|
|
+ if (ipv4_is_local_multicast(im->multiaddr) &&
|
|
|
|
+ !sysctl_igmp_llm_reports)
|
|
|
|
+ continue;
|
|
|
|
|
|
/* a failover is happening and switches
|
|
/* a failover is happening and switches
|
|
* must be notified immediately
|
|
* must be notified immediately
|