提交 bc8c20ac 编写于 作者: S Satish Ashok 提交者: David S. Miller

bridge: multicast: treat igmpv3 report with INCLUDE and no sources as a leave

A report with INCLUDE/Change_to_include and empty source list should be
treated as a leave, specified by RFC 3376, section 3.1:
"If the requested filter mode is INCLUDE *and* the requested source
 list is empty, then the entry corresponding to the requested
 interface and multicast address is deleted if present.  If no such
 entry is present, the request is ignored."
Signed-off-by: NSatish Ashok <sashok@cumulusnetworks.com>
Signed-off-by: NNikolay Aleksandrov <nikolay@cumulusnetworks.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 89c22d8c
...@@ -39,6 +39,16 @@ static void br_multicast_start_querier(struct net_bridge *br, ...@@ -39,6 +39,16 @@ static void br_multicast_start_querier(struct net_bridge *br,
struct bridge_mcast_own_query *query); struct bridge_mcast_own_query *query);
static void br_multicast_add_router(struct net_bridge *br, static void br_multicast_add_router(struct net_bridge *br,
struct net_bridge_port *port); struct net_bridge_port *port);
static void br_ip4_multicast_leave_group(struct net_bridge *br,
struct net_bridge_port *port,
__be32 group,
__u16 vid);
#if IS_ENABLED(CONFIG_IPV6)
static void br_ip6_multicast_leave_group(struct net_bridge *br,
struct net_bridge_port *port,
const struct in6_addr *group,
__u16 vid);
#endif
unsigned int br_mdb_rehash_seq; unsigned int br_mdb_rehash_seq;
static inline int br_ip_equal(const struct br_ip *a, const struct br_ip *b) static inline int br_ip_equal(const struct br_ip *a, const struct br_ip *b)
...@@ -1010,9 +1020,15 @@ static int br_ip4_multicast_igmp3_report(struct net_bridge *br, ...@@ -1010,9 +1020,15 @@ static int br_ip4_multicast_igmp3_report(struct net_bridge *br,
continue; continue;
} }
err = br_ip4_multicast_add_group(br, port, group, vid); if ((type == IGMPV3_CHANGE_TO_INCLUDE ||
if (err) type == IGMPV3_MODE_IS_INCLUDE) &&
break; ntohs(grec->grec_nsrcs) == 0) {
br_ip4_multicast_leave_group(br, port, group, vid);
} else {
err = br_ip4_multicast_add_group(br, port, group, vid);
if (err)
break;
}
} }
return err; return err;
...@@ -1071,10 +1087,17 @@ static int br_ip6_multicast_mld2_report(struct net_bridge *br, ...@@ -1071,10 +1087,17 @@ static int br_ip6_multicast_mld2_report(struct net_bridge *br,
continue; continue;
} }
err = br_ip6_multicast_add_group(br, port, &grec->grec_mca, if ((grec->grec_type == MLD2_CHANGE_TO_INCLUDE ||
vid); grec->grec_type == MLD2_MODE_IS_INCLUDE) &&
if (err) ntohs(*nsrcs) == 0) {
break; br_ip6_multicast_leave_group(br, port, &grec->grec_mca,
vid);
} else {
err = br_ip6_multicast_add_group(br, port,
&grec->grec_mca, vid);
if (!err)
break;
}
} }
return err; return err;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册