]> git.puffer.fish Git - mirror/frr.git/commitdiff
pimd: when node changes from non-DR to DR S,G entry not created 7753/head
authorMobashshera Rasool <mrasool@vmware.com>
Thu, 17 Dec 2020 10:37:25 +0000 (10:37 +0000)
committerMobashshera Rasool <mrasool@vmware.com>
Thu, 17 Dec 2020 13:14:29 +0000 (13:14 +0000)
1. When a node changes from non-DR to DR in the given topology,
the node was receiving both PIM Join as well as IGMP join.
Since it was already receiving PIM Join previously, ifchannel was
already present. Hence when it becomes DR, the IGMP source flag is not
set due to issue in the code. Hence it never creates S,G entry thinking
that it is not DR.

2. When pim join expires, the pim flag is not reset when ifchannel is not
deleted.

Issue: #7752

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

index e7ff434f4b2f952f989e5def66958d60b3556991..fc0f514a49a4a25754827c8f3b192fc20c51a9c8 100644 (file)
@@ -550,8 +550,21 @@ struct pim_ifchannel *pim_ifchannel_add(struct interface *ifp,
        struct pim_upstream *up;
 
        ch = pim_ifchannel_find(ifp, sg);
-       if (ch)
+       if (ch) {
+               if (up_flags == PIM_UPSTREAM_FLAG_MASK_SRC_PIM)
+                       PIM_IF_FLAG_SET_PROTO_PIM(ch->flags);
+
+               if (up_flags == PIM_UPSTREAM_FLAG_MASK_SRC_IGMP)
+                       PIM_IF_FLAG_SET_PROTO_IGMP(ch->flags);
+
+               if (ch->upstream)
+                       ch->upstream->flags |= up_flags;
+               else if (PIM_DEBUG_EVENTS)
+                       zlog_debug("%s:%s No Upstream found", __func__,
+                                  pim_str_sg_dump(sg));
+
                return ch;
+       }
 
        pim_ifp = ifp->info;
 
@@ -642,6 +655,12 @@ static void ifjoin_to_noinfo(struct pim_ifchannel *ch, bool ch_del)
 {
        pim_forward_stop(ch, !ch_del);
        pim_ifchannel_ifjoin_switch(__func__, ch, PIM_IFJOIN_NOINFO);
+
+       if (ch->upstream)
+               PIM_UPSTREAM_FLAG_UNSET_SRC_PIM(ch->upstream->flags);
+
+       PIM_IF_FLAG_UNSET_PROTO_PIM(ch->flags);
+
        if (ch_del)
                delete_on_noinfo(ch);
 }
@@ -1272,6 +1291,13 @@ void pim_ifchannel_local_membership_del(struct interface *ifp,
                         * parent' delete_no_info */
                }
        }
+
+       /* Resettng the IGMP flags here */
+       if (orig->upstream)
+               PIM_UPSTREAM_FLAG_UNSET_SRC_IGMP(orig->upstream->flags);
+
+       PIM_IF_FLAG_UNSET_PROTO_IGMP(orig->flags);
+
        delete_on_noinfo(orig);
 }