summaryrefslogtreecommitdiff
path: root/pimd/pim_util.c
diff options
context:
space:
mode:
authorQuentin Young <qlyoung@cumulusnetworks.com>2017-09-01 14:33:00 -0400
committerQuentin Young <qlyoung@cumulusnetworks.com>2017-09-26 13:00:52 -0400
commitb0f525a84c16807ccb3897d037d5052ba342df0f (patch)
tree16bcf93c4bfc02009442fcf54113a404c9731094 /pimd/pim_util.c
parent5c4dc90307b3718ea5f9ed093b994d0c586d370a (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_util.c')
-rw-r--r--pimd/pim_util.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/pimd/pim_util.c b/pimd/pim_util.c
index 820117a03a..15bde256da 100644
--- a/pimd/pim_util.c
+++ b/pimd/pim_util.c
@@ -21,6 +21,7 @@
#include "log.h"
#include "prefix.h"
+#include "plist.h"
#include "pim_util.h"
@@ -114,7 +115,7 @@ int pim_is_group_224_0_0_0_24(struct in_addr group_addr)
group.family = AF_INET;
group.u.prefix4 = group_addr;
- group.prefixlen = 32;
+ group.prefixlen = IPV4_MAX_PREFIXLEN;
return prefix_match(&group_224, &group);
}
@@ -137,3 +138,19 @@ int pim_is_group_224_4(struct in_addr group_addr)
return prefix_match(&group_all, &group);
}
+
+bool pim_is_group_filtered(struct pim_interface *pim_ifp, struct in_addr *grp)
+{
+ struct prefix grp_pfx;
+ struct prefix_list *pl;
+
+ if (!pim_ifp->boundary_oil_plist)
+ return false;
+
+ grp_pfx.family = AF_INET;
+ grp_pfx.prefixlen = 32;
+ grp_pfx.u.prefix4 = *grp;
+
+ pl = prefix_list_lookup(AFI_IP, pim_ifp->boundary_oil_plist);
+ return pl ? prefix_list_apply(pl, &grp_pfx) == PREFIX_DENY : false;
+}