diff options
| author | Quentin Young <qlyoung@cumulusnetworks.com> | 2017-09-01 14:33:00 -0400 |
|---|---|---|
| committer | Quentin Young <qlyoung@cumulusnetworks.com> | 2017-09-26 13:00:52 -0400 |
| commit | b0f525a84c16807ccb3897d037d5052ba342df0f (patch) | |
| tree | 16bcf93c4bfc02009442fcf54113a404c9731094 /pimd/pim_join.c | |
| parent | 5c4dc90307b3718ea5f9ed093b994d0c586d370a (diff) | |
pimd: add support for boundaries
Adds the ability to filter PIM Joins & IGMP reports on an interface.
Enabling a multicast boundary on an interface for a particular group
will prevent the interface from appearing in the group's OIL.
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Diffstat (limited to 'pimd/pim_join.c')
| -rw-r--r-- | pimd/pim_join.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/pimd/pim_join.c b/pimd/pim_join.c index 4f5e534010..ae5032be73 100644 --- a/pimd/pim_join.c +++ b/pimd/pim_join.c @@ -38,6 +38,7 @@ #include "pim_rpf.h" #include "pim_rp.h" #include "pim_jp_agg.h" +#include "pim_util.h" static void on_trace(const char *label, struct interface *ifp, struct in_addr src) @@ -153,6 +154,7 @@ int pim_joinprune_recv(struct interface *ifp, struct pim_neighbor *neigh, int tlv_buf_size) { struct prefix msg_upstream_addr; + struct pim_interface *pim_ifp; uint8_t msg_num_groups; uint16_t msg_holdtime; int addr_offset; @@ -163,6 +165,7 @@ int pim_joinprune_recv(struct interface *ifp, struct pim_neighbor *neigh, buf = tlv_buf; pastend = tlv_buf + tlv_buf_size; + pim_ifp = ifp->info; /* Parse ucast addr @@ -231,6 +234,7 @@ int pim_joinprune_recv(struct interface *ifp, struct pim_neighbor *neigh, uint16_t msg_num_pruned_sources; int source; struct pim_ifchannel *starg_ch = NULL, *sg_ch = NULL; + bool filtered = false; memset(&sg, 0, sizeof(struct prefix_sg)); addr_offset = pim_parse_addr_group(&sg, buf, pastend - buf); @@ -273,6 +277,9 @@ int pim_joinprune_recv(struct interface *ifp, struct pim_neighbor *neigh, src_str, ifp->name); } + /* boundary check */ + filtered = pim_is_group_filtered(pim_ifp, &sg.grp); + /* Scan joined sources */ for (source = 0; source < msg_num_joined_sources; ++source) { addr_offset = pim_parse_addr_source( @@ -283,6 +290,10 @@ int pim_joinprune_recv(struct interface *ifp, struct pim_neighbor *neigh, buf += addr_offset; + /* if we are filtering this group, skip the join */ + if (filtered) + continue; + recv_join(ifp, neigh, msg_holdtime, msg_upstream_addr.u.prefix4, &sg, msg_source_flags); @@ -304,6 +315,11 @@ int pim_joinprune_recv(struct interface *ifp, struct pim_neighbor *neigh, } buf += addr_offset; + + /* if we are filtering this group, skip the prune */ + if (filtered) + continue; + recv_prune(ifp, neigh, msg_holdtime, msg_upstream_addr.u.prefix4, &sg, msg_source_flags); @@ -335,7 +351,7 @@ int pim_joinprune_recv(struct interface *ifp, struct pim_neighbor *neigh, } } } - if (starg_ch) + if (starg_ch && !filtered) pim_ifchannel_set_star_g_join_state(starg_ch, 1, 0); starg_ch = NULL; } /* scan groups */ |
