return addr->s6_addr[1] & 0xf;
}
-static inline bool in6_multicast_nofwd(const pim_addr *addr)
+bool in6_multicast_nofwd(const pim_addr *addr)
{
return in6_multicast_scope(addr) <= IPV6_MULTICAST_SCOPE_LINK;
}
* interface -> (S,G)
*/
-static int gm_sg_cmp(const struct gm_sg *a, const struct gm_sg *b)
+int gm_sg_cmp(const struct gm_sg *a, const struct gm_sg *b)
{
return pim_sgaddr_cmp(a->sgaddr, b->sgaddr);
}
-DECLARE_RBTREE_UNIQ(gm_sgs, struct gm_sg, itm, gm_sg_cmp);
-
static struct gm_sg *gm_sg_find(struct gm_if *gm_ifp, pim_addr grp,
pim_addr src)
{
*/
struct gm_packet_sg *most_recent;
};
+int gm_sg_cmp(const struct gm_sg *a, const struct gm_sg *b);
+DECLARE_RBTREE_UNIQ(gm_sgs, struct gm_sg, itm, gm_sg_cmp);
/* host tracking entry. addr will be one of:
*
#endif
extern void gm_cli_init(void);
+bool in6_multicast_nofwd(const pim_addr *addr);
#endif /* PIM6_MLD_H */
static void pim_if_membership_refresh(struct interface *ifp)
{
struct pim_interface *pim_ifp;
+#if PIM_IPV == 4
struct listnode *grpnode;
struct gm_group *grp;
-
+#else
+ struct gm_if *gm_ifp;
+ struct gm_sg *sg, *sg_start;
+#endif
pim_ifp = ifp->info;
assert(pim_ifp);
+#if PIM_IPV == 6
+ gm_ifp = pim_ifp->mld;
+#endif
if (!pim_ifp->pim_enable)
return;
pim_ifchannel_membership_clear(ifp);
+#if PIM_IPV == 4
/*
* Then restore PIM (S,G) membership from all IGMPv3 (S,G) entries on
* the interface
} /* scan group sources */
} /* scan igmp groups */
+#else
+ sg_start = gm_sgs_first(gm_ifp->sgs);
+
+ frr_each_from (gm_sgs, gm_ifp->sgs, sg, sg_start) {
+ if (!in6_multicast_nofwd(&sg->sgaddr.grp)) {
+ pim_ifchannel_local_membership_add(
+ ifp, &sg->sgaddr, false /*is_vxlan*/);
+ }
+ }
+#endif
/*
* Finally delete every PIM (S,G) entry lacking all state info