mirror of
https://github.com/openvswitch/ovs
synced 2025-08-31 14:25:26 +00:00
mcast-snooping: Add Multicast Listener Discovery support
Add support for MLDv1 and MLDv2. The behavior is not that different from IGMP. Packets to all-hosts address and queries are always flooded, reports go to routers, routers are added when a query is observed, and all MLD packets go through slow path. Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@redhat.com> Cc: Flavio Leitner <fbl@redhat.com> Cc: Ben Pfaff <blp@nicira.com> [blp@nicira.com moved an assignment out of an 'if' statement] Signed-off-by: Ben Pfaff <blp@nicira.com>
This commit is contained in:
committed by
Ben Pfaff
parent
964a4d5fd5
commit
06994f879c
25
lib/flow.h
25
lib/flow.h
@@ -758,6 +758,31 @@ static inline bool is_icmpv6(const struct flow *flow)
|
||||
&& flow->nw_proto == IPPROTO_ICMPV6);
|
||||
}
|
||||
|
||||
static inline bool is_igmp(const struct flow *flow)
|
||||
{
|
||||
return (flow->dl_type == htons(ETH_TYPE_IP)
|
||||
&& flow->nw_proto == IPPROTO_IGMP);
|
||||
}
|
||||
|
||||
static inline bool is_mld(const struct flow *flow)
|
||||
{
|
||||
return is_icmpv6(flow)
|
||||
&& (flow->tp_src == htons(MLD_QUERY)
|
||||
|| flow->tp_src == htons(MLD_REPORT)
|
||||
|| flow->tp_src == htons(MLD_DONE)
|
||||
|| flow->tp_src == htons(MLD2_REPORT));
|
||||
}
|
||||
|
||||
static inline bool is_mld_query(const struct flow *flow)
|
||||
{
|
||||
return is_icmpv6(flow) && flow->tp_src == htons(MLD_QUERY);
|
||||
}
|
||||
|
||||
static inline bool is_mld_report(const struct flow *flow)
|
||||
{
|
||||
return is_mld(flow) && !is_mld_query(flow);
|
||||
}
|
||||
|
||||
static inline bool is_stp(const struct flow *flow)
|
||||
{
|
||||
return (eth_addr_equals(flow->dl_dst, eth_addr_stp)
|
||||
|
Reference in New Issue
Block a user