]> git.proxmox.com Git - mirror_frr.git/commitdiff
pimd: Fix the setting of oif_flags in channel oil
authorMobashshera Rasool <mrasool@vmware.com>
Wed, 15 Jun 2022 07:34:46 +0000 (00:34 -0700)
committerMobashshera Rasool <mrasool@vmware.com>
Wed, 15 Jun 2022 07:55:55 +0000 (00:55 -0700)
When pim_upstream_inherited_olist_decide calls the api
pim_channel_add_oif, it can pass PIM_OIF_FLAG_PROTO_GM,
PIM_OIF_FLAG_PROTO_PIM and/or PIM_OIF_FLAG_PROTO_STAR.
Now a consider a case where PIM flag was already set
but STAR flag was not set and this api tries to set
both STAR + PIM and passes the same. The api pim_channel_add_oif
returns since it sees that PIM is already set without
setting the STAR flag.

So basically this will lead to issues in scenarios where for the
same OIF multiple flags(IGMP, PIM, STAR) needs to be set.

Fixing it for all combinations.

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
pimd/pim_oil.c

index 8fa2c96034c0123042f751daf9f427bd2c40d126..3bfb31e0c6978d6a83588e95b3d8577bd21002d0 100644 (file)
@@ -429,6 +429,8 @@ int pim_channel_add_oif(struct channel_oil *channel_oil, struct interface *oif,
        /* Prevent single protocol from subscribing same interface to
           channel (S,G) multiple times */
        if (channel_oil->oif_flags[pim_ifp->mroute_vif_index] & proto_mask) {
+               channel_oil->oif_flags[pim_ifp->mroute_vif_index] |= proto_mask;
+
                if (PIM_DEBUG_MROUTE) {
                        zlog_debug(
                                "%s %s: existing protocol mask %u requested OIF %s (vif_index=%d, min_ttl=%d) for channel (S,G)=(%pPAs,%pPAs)",