pimd: Changing PIM_OIF_FLAG_PROTO_IGMP to PIM_OIF_FLAG_PROTO_GM

Modified marco name so that it can be reused in mld.

Signed-off-by: Abhishek N R <abnr@vmware.com>
This commit is contained in:
Abhishek N R 2022-04-13 01:00:50 -07:00
parent 5cc9af2a6d
commit 80a82b567f
8 changed files with 26 additions and 28 deletions

View File

@ -4065,8 +4065,8 @@ static void show_mroute(struct pim_instance *pim, struct vty *vty,
json_object_boolean_true_add( json_object_boolean_true_add(
json_ifp_out, "protocolPim"); json_ifp_out, "protocolPim");
if (c_oil->oif_flags[oif_vif_index] if (c_oil->oif_flags[oif_vif_index] &
& PIM_OIF_FLAG_PROTO_IGMP) PIM_OIF_FLAG_PROTO_GM)
json_object_boolean_true_add( json_object_boolean_true_add(
json_ifp_out, "protocolIgmp"); json_ifp_out, "protocolIgmp");
@ -4110,8 +4110,8 @@ static void show_mroute(struct pim_instance *pim, struct vty *vty,
strlcpy(proto, "PIM", sizeof(proto)); strlcpy(proto, "PIM", sizeof(proto));
} }
if (c_oil->oif_flags[oif_vif_index] if (c_oil->oif_flags[oif_vif_index] &
& PIM_OIF_FLAG_PROTO_IGMP) { PIM_OIF_FLAG_PROTO_GM) {
strlcpy(proto, "IGMP", sizeof(proto)); strlcpy(proto, "IGMP", sizeof(proto));
} }

View File

@ -1166,7 +1166,7 @@ void pim_show_state(struct pim_instance *pim, struct vty *vty,
out_ifname, out_ifname,
(c_oil->oif_flags (c_oil->oif_flags
[oif_vif_index] & [oif_vif_index] &
PIM_OIF_FLAG_PROTO_IGMP) PIM_OIF_FLAG_PROTO_GM)
? 'I' ? 'I'
: ' ', : ' ',
(c_oil->oif_flags (c_oil->oif_flags
@ -1194,7 +1194,7 @@ void pim_show_state(struct pim_instance *pim, struct vty *vty,
out_ifname, out_ifname,
(c_oil->oif_flags (c_oil->oif_flags
[oif_vif_index] & [oif_vif_index] &
PIM_OIF_FLAG_PROTO_IGMP) PIM_OIF_FLAG_PROTO_GM)
? 'I' ? 'I'
: ' ', : ' ',
(c_oil->oif_flags (c_oil->oif_flags

View File

@ -138,7 +138,7 @@ void pim_ifchannel_delete(struct pim_ifchannel *ch)
if (ch->upstream->channel_oil) { if (ch->upstream->channel_oil) {
uint32_t mask = PIM_OIF_FLAG_PROTO_PIM; uint32_t mask = PIM_OIF_FLAG_PROTO_PIM;
if (ch->upstream->flags & PIM_UPSTREAM_FLAG_MASK_SRC_IGMP) if (ch->upstream->flags & PIM_UPSTREAM_FLAG_MASK_SRC_IGMP)
mask |= PIM_OIF_FLAG_PROTO_IGMP; mask |= PIM_OIF_FLAG_PROTO_GM;
/* /*
* A S,G RPT channel can have an empty oil, we also * A S,G RPT channel can have an empty oil, we also
@ -1227,14 +1227,13 @@ int pim_ifchannel_local_membership_add(struct interface *ifp, pim_sgaddr *sg,
== PREFIX_DENY) { == PREFIX_DENY) {
pim_channel_add_oif( pim_channel_add_oif(
up->channel_oil, pim->regiface, up->channel_oil, pim->regiface,
PIM_OIF_FLAG_PROTO_IGMP, PIM_OIF_FLAG_PROTO_GM,
__func__); __func__);
} }
} }
} else } else
pim_channel_add_oif(up->channel_oil, pim->regiface, pim_channel_add_oif(up->channel_oil, pim->regiface,
PIM_OIF_FLAG_PROTO_IGMP, PIM_OIF_FLAG_PROTO_GM, __func__);
__func__);
} }
return 1; return 1;

View File

@ -739,7 +739,7 @@ bool pim_mroute_allow_iif_in_oil(struct channel_oil *c_oil,
pim_ifp = ifp_out->info; pim_ifp = ifp_out->info;
if (!pim_ifp) if (!pim_ifp)
return false; return false;
if ((c_oil->oif_flags[oif_index] & PIM_OIF_FLAG_PROTO_IGMP) && if ((c_oil->oif_flags[oif_index] & PIM_OIF_FLAG_PROTO_GM) &&
PIM_I_am_DR(pim_ifp)) PIM_I_am_DR(pim_ifp))
return true; return true;

View File

@ -27,18 +27,18 @@ struct pim_interface;
/* /*
* Where did we get this (S,G) from? * Where did we get this (S,G) from?
* *
* IGMP - Learned from IGMP * GM - Learned from IGMP/MLD
* PIM - Learned from PIM * PIM - Learned from PIM
* SOURCE - Learned from Source multicast packet received * SOURCE - Learned from Source multicast packet received
* STAR - Inherited * STAR - Inherited
*/ */
#define PIM_OIF_FLAG_PROTO_IGMP (1 << 0) #define PIM_OIF_FLAG_PROTO_GM (1 << 0)
#define PIM_OIF_FLAG_PROTO_PIM (1 << 1) #define PIM_OIF_FLAG_PROTO_PIM (1 << 1)
#define PIM_OIF_FLAG_PROTO_STAR (1 << 2) #define PIM_OIF_FLAG_PROTO_STAR (1 << 2)
#define PIM_OIF_FLAG_PROTO_VXLAN (1 << 3) #define PIM_OIF_FLAG_PROTO_VXLAN (1 << 3)
#define PIM_OIF_FLAG_PROTO_ANY \ #define PIM_OIF_FLAG_PROTO_ANY \
(PIM_OIF_FLAG_PROTO_IGMP | PIM_OIF_FLAG_PROTO_PIM \ (PIM_OIF_FLAG_PROTO_GM | PIM_OIF_FLAG_PROTO_PIM | \
| PIM_OIF_FLAG_PROTO_STAR | PIM_OIF_FLAG_PROTO_VXLAN) PIM_OIF_FLAG_PROTO_STAR | PIM_OIF_FLAG_PROTO_VXLAN)
/* OIF is present in the OIL but must not be used for forwarding traffic */ /* OIF is present in the OIL but must not be used for forwarding traffic */
#define PIM_OIF_FLAG_MUTE (1 << 4) #define PIM_OIF_FLAG_MUTE (1 << 4)

View File

@ -110,8 +110,8 @@ bool tib_sg_gm_join(struct pim_instance *pim, pim_sgaddr sg,
if (PIM_I_am_DR(pim_oif) || PIM_I_am_DualActive(pim_oif)) { if (PIM_I_am_DR(pim_oif) || PIM_I_am_DualActive(pim_oif)) {
int result; int result;
result = pim_channel_add_oif(*oilp, oif, result = pim_channel_add_oif(*oilp, oif, PIM_OIF_FLAG_PROTO_GM,
PIM_OIF_FLAG_PROTO_IGMP, __func__); __func__);
if (result) { if (result) {
if (PIM_DEBUG_MROUTE) if (PIM_DEBUG_MROUTE)
zlog_warn("%s: add_oif() failed with return=%d", zlog_warn("%s: add_oif() failed with return=%d",
@ -136,7 +136,7 @@ bool tib_sg_gm_join(struct pim_instance *pim, pim_sgaddr sg,
"%s: Failure to add local membership for %pSG", "%s: Failure to add local membership for %pSG",
__func__, &sg); __func__, &sg);
pim_channel_del_oif(*oilp, oif, PIM_OIF_FLAG_PROTO_IGMP, pim_channel_del_oif(*oilp, oif, PIM_OIF_FLAG_PROTO_GM,
__func__); __func__);
return false; return false;
} }
@ -160,7 +160,7 @@ void tib_sg_gm_prune(struct pim_instance *pim, pim_sgaddr sg,
fixes the issue without ill effect, similar to fixes the issue without ill effect, similar to
pim_forward_stop below. pim_forward_stop below.
*/ */
result = pim_channel_del_oif(*oilp, oif, PIM_OIF_FLAG_PROTO_IGMP, result = pim_channel_del_oif(*oilp, oif, PIM_OIF_FLAG_PROTO_GM,
__func__); __func__);
if (result) { if (result) {
if (PIM_DEBUG_IGMP_TRACE) if (PIM_DEBUG_IGMP_TRACE)

View File

@ -1838,7 +1838,7 @@ int pim_upstream_inherited_olist_decide(struct pim_instance *pim,
flag = PIM_OIF_FLAG_PROTO_STAR; flag = PIM_OIF_FLAG_PROTO_STAR;
else { else {
if (PIM_IF_FLAG_TEST_PROTO_IGMP(ch->flags)) if (PIM_IF_FLAG_TEST_PROTO_IGMP(ch->flags))
flag = PIM_OIF_FLAG_PROTO_IGMP; flag = PIM_OIF_FLAG_PROTO_GM;
if (PIM_IF_FLAG_TEST_PROTO_PIM(ch->flags)) if (PIM_IF_FLAG_TEST_PROTO_PIM(ch->flags))
flag |= PIM_OIF_FLAG_PROTO_PIM; flag |= PIM_OIF_FLAG_PROTO_PIM;
if (starch) if (starch)
@ -2116,7 +2116,7 @@ void pim_upstream_add_lhr_star_pimreg(struct pim_instance *pim)
continue; continue;
pim_channel_add_oif(up->channel_oil, pim->regiface, pim_channel_add_oif(up->channel_oil, pim->regiface,
PIM_OIF_FLAG_PROTO_IGMP, __func__); PIM_OIF_FLAG_PROTO_GM, __func__);
} }
} }
@ -2161,18 +2161,17 @@ void pim_upstream_remove_lhr_star_pimreg(struct pim_instance *pim,
if (!nlist) { if (!nlist) {
pim_channel_del_oif(up->channel_oil, pim->regiface, pim_channel_del_oif(up->channel_oil, pim->regiface,
PIM_OIF_FLAG_PROTO_IGMP, __func__); PIM_OIF_FLAG_PROTO_GM, __func__);
continue; continue;
} }
pim_addr_to_prefix(&g, up->sg.grp); pim_addr_to_prefix(&g, up->sg.grp);
apply_new = prefix_list_apply(np, &g); apply_new = prefix_list_apply(np, &g);
if (apply_new == PREFIX_DENY) if (apply_new == PREFIX_DENY)
pim_channel_add_oif(up->channel_oil, pim->regiface, pim_channel_add_oif(up->channel_oil, pim->regiface,
PIM_OIF_FLAG_PROTO_IGMP, PIM_OIF_FLAG_PROTO_GM, __func__);
__func__);
else else
pim_channel_del_oif(up->channel_oil, pim->regiface, pim_channel_del_oif(up->channel_oil, pim->regiface,
PIM_OIF_FLAG_PROTO_IGMP, __func__); PIM_OIF_FLAG_PROTO_GM, __func__);
} }
} }

View File

@ -499,7 +499,7 @@ void pim_forward_start(struct pim_ifchannel *ch)
ch->interface->name, &up->upstream_addr); ch->interface->name, &up->upstream_addr);
if (PIM_IF_FLAG_TEST_PROTO_IGMP(ch->flags)) if (PIM_IF_FLAG_TEST_PROTO_IGMP(ch->flags))
mask = PIM_OIF_FLAG_PROTO_IGMP; mask = PIM_OIF_FLAG_PROTO_GM;
if (PIM_IF_FLAG_TEST_PROTO_PIM(ch->flags)) if (PIM_IF_FLAG_TEST_PROTO_PIM(ch->flags))
mask |= PIM_OIF_FLAG_PROTO_PIM; mask |= PIM_OIF_FLAG_PROTO_PIM;