sg.src = src->source_addr;
sg.grp = grp->group_addr;
pim_ifchannel_local_membership_add(ifp,
- &sg);
+ &sg, false /*is_vxlan*/);
}
} /* scan group sources */
/*
* If we are going to be a LHR, we need to note it
*/
- if (ch->upstream->parent && (ch->upstream->parent->flags
- & PIM_UPSTREAM_FLAG_MASK_SRC_IGMP)
+ if (ch->upstream->parent &&
+ (PIM_UPSTREAM_FLAG_TEST_CAN_BE_LHR(
+ ch->upstream->parent->flags))
&& !(ch->upstream->flags
& PIM_UPSTREAM_FLAG_MASK_SRC_LHR)) {
pim_upstream_ref(ch->upstream,
}
int pim_ifchannel_local_membership_add(struct interface *ifp,
- struct prefix_sg *sg)
+ struct prefix_sg *sg, bool is_vxlan)
{
struct pim_ifchannel *ch, *starch;
struct pim_interface *pim_ifp;
struct pim_instance *pim;
+ int up_flags;
/* PIM enabled on interface? */
pim_ifp = ifp->info;
}
}
- ch = pim_ifchannel_add(ifp, sg, 0, PIM_UPSTREAM_FLAG_MASK_SRC_IGMP);
+ up_flags = is_vxlan ? PIM_UPSTREAM_FLAG_MASK_SRC_VXLAN_TERM :
+ PIM_UPSTREAM_FLAG_MASK_SRC_IGMP;
+ ch = pim_ifchannel_add(ifp, sg, 0, up_flags);
ifmembership_set(ch, PIM_IFMEMBERSHIP_INCLUDE);
struct prefix_sg *sg, uint8_t source_flags,
uint16_t holdtime);
int pim_ifchannel_local_membership_add(struct interface *ifp,
- struct prefix_sg *sg);
+ struct prefix_sg *sg, bool is_vxlan);
void pim_ifchannel_local_membership_del(struct interface *ifp,
struct prefix_sg *sg);
up = pim_upstream_find(pim_ifp->pim, &star);
- if (up && PIM_UPSTREAM_FLAG_TEST_SRC_IGMP(up->flags)) {
+ if (up && PIM_UPSTREAM_FLAG_TEST_CAN_BE_LHR(up->flags)) {
up = pim_upstream_add(pim_ifp->pim, &sg, ifp,
PIM_UPSTREAM_FLAG_MASK_SRC_LHR,
__PRETTY_FUNCTION__, NULL);
if (up->sg.src.s_addr != INADDR_ANY)
continue;
- if (!PIM_UPSTREAM_FLAG_TEST_SRC_IGMP(up->flags))
+ if (!PIM_UPSTREAM_FLAG_TEST_CAN_BE_LHR(up->flags))
continue;
pim_channel_add_oif(up->channel_oil, pim->regiface,
if (up->sg.src.s_addr != INADDR_ANY)
continue;
- if (!PIM_UPSTREAM_FLAG_TEST_SRC_IGMP(up->flags))
+ if (!PIM_UPSTREAM_FLAG_TEST_CAN_BE_LHR(up->flags))
continue;
if (!nlist) {
#define PIM_UPSTREAM_FLAG_TEST_MLAG_PEER(flags) ((flags) & PIM_UPSTREAM_FLAG_MASK_MLAG_PEER)
#define PIM_UPSTREAM_FLAG_TEST_SRC_NOCACHE(flags) ((flags) &PIM_UPSTREAM_FLAG_MASK_SRC_NOCACHE)
#define PIM_UPSTREAM_FLAG_TEST_USE_RPT(flags) ((flags) & PIM_UPSTREAM_FLAG_MASK_USE_RPT)
+#define PIM_UPSTREAM_FLAG_TEST_CAN_BE_LHR(flags) ((flags) & (PIM_UPSTREAM_FLAG_MASK_SRC_IGMP | PIM_UPSTREAM_FLAG_MASK_SRC_VXLAN_TERM))
#define PIM_UPSTREAM_FLAG_SET_DR_JOIN_DESIRED(flags) ((flags) |= PIM_UPSTREAM_FLAG_MASK_DR_JOIN_DESIRED)
#define PIM_UPSTREAM_FLAG_SET_DR_JOIN_DESIRED_UPDATED(flags) ((flags) |= PIM_UPSTREAM_FLAG_MASK_DR_JOIN_DESIRED_UPDATED)
vxlan_sg->sg_str, vxlan_sg->term_oif->name);
if (pim_ifchannel_local_membership_add(vxlan_sg->term_oif,
- &vxlan_sg->sg)) {
+ &vxlan_sg->sg, true /*is_vxlan */)) {
vxlan_sg->flags |= PIM_VXLAN_SGF_OIF_INSTALLED;
/* update the inherited OIL */
/* XXX - I don't see the inherited OIL updated when a local
"local membership add for %s as G is now ASM",
pim_str_sg_dump(&sg));
pim_ifchannel_local_membership_add(
- group->group_igmp_sock->interface, &sg);
+ group->group_igmp_sock->interface, &sg,
+ false /*is_vxlan*/);
}
}
}
per-interface (S,G) state.
*/
if (!pim_ifchannel_local_membership_add(
- group->group_igmp_sock->interface, &sg)) {
+ group->group_igmp_sock->interface, &sg,
+ false /*is_vxlan*/)) {
if (PIM_DEBUG_MROUTE)
zlog_warn("%s: Failure to add local membership for %s",
__PRETTY_FUNCTION__, pim_str_sg_dump(&sg));