summaryrefslogtreecommitdiffstats
path: root/pimd/pim_util.c
diff options
context:
space:
mode:
authorSarita Patra <saritap@vmware.com>2022-10-13 06:37:28 +0200
committerSarita Patra <saritap@vmware.com>2022-10-20 10:11:52 +0200
commitdce0f7468d4b1f3bb39dfdd0e768138bebb08b0d (patch)
tree55389e08a91661fa60511aceb0dd80ab319b36ba /pimd/pim_util.c
parentMerge pull request #12034 from opensourcerouting/fix/gr_hard_notification (diff)
downloadfrr-dce0f7468d4b1f3bb39dfdd0e768138bebb08b0d.tar.xz
frr-dce0f7468d4b1f3bb39dfdd0e768138bebb08b0d.zip
pimd, pim6d: Define pim_addr_is_multicast API
pim_addr_is_multicast API will check if the address is multicast address or not. Signed-off-by: Sarita Patra <saritap@vmware.com>
Diffstat (limited to 'pimd/pim_util.c')
-rw-r--r--pimd/pim_util.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/pimd/pim_util.c b/pimd/pim_util.c
index 4b67dbf1b..150e1a01e 100644
--- a/pimd/pim_util.c
+++ b/pimd/pim_util.c
@@ -166,3 +166,15 @@ int pim_get_all_mcast_group(struct prefix *prefix)
#endif
return 1;
}
+
+bool pim_addr_is_multicast(pim_addr addr)
+{
+#if PIM_IPV == 4
+ if (IN_MULTICAST(addr.s_addr))
+ return true;
+#else
+ if (IN6_IS_ADDR_MULTICAST(&addr))
+ return true;
+#endif
+ return false;
+}