]> git.proxmox.com Git - mirror_frr.git/blobdiff - pimd/pim_mroute.c
Merge pull request #11114 from opensourcerouting/vrf-declvar-macros
[mirror_frr.git] / pimd / pim_mroute.c
index 7fc4f12d27678804f89bd80d664d5b0cc5aa8159..b7f483dbc0d46e33fad59766f1b2b2c52e926fbc 100644 (file)
@@ -437,6 +437,28 @@ int pim_mroute_msg_wrvifwhole(int fd, struct interface *ifp, const char *buf)
                                                pim_ifp->primary_address,
                                                up->upstream_register);
                                up->sptbit = PIM_UPSTREAM_SPTBIT_TRUE;
+                       } else {
+                               /*
+                                * At this point pimd is connected to
+                                * the source, it has a parent, we are not
+                                * the RP  and the SPTBIT should be set
+                                * since we know *the* S,G is on the SPT.
+                                * The first time this happens, let's cause
+                                * an immediate join to go out so that
+                                * the RP can trim this guy immediately
+                                * if necessary, instead of waiting
+                                * one join/prune send cycle
+                                */
+                               if (up->sptbit != PIM_UPSTREAM_SPTBIT_TRUE &&
+                                   up->parent &&
+                                   up->rpf.source_nexthop.interface !=
+                                           up->parent->rpf.source_nexthop
+                                                   .interface) {
+                                       up->sptbit = PIM_UPSTREAM_SPTBIT_TRUE;
+                                       pim_jp_agg_single_upstream_send(
+                                               &up->parent->rpf, up->parent,
+                                               true);
+                               }
                        }
                        pim_upstream_keep_alive_timer_start(
                                up, pim_ifp->pim->keep_alive_time);
@@ -717,8 +739,8 @@ bool pim_mroute_allow_iif_in_oil(struct channel_oil *c_oil,
        pim_ifp = ifp_out->info;
        if (!pim_ifp)
                return false;
-       if ((c_oil->oif_flags[oif_index] & PIM_OIF_FLAG_PROTO_IGMP) &&
-                       PIM_I_am_DR(pim_ifp))
+       if ((c_oil->oif_flags[oif_index] & PIM_OIF_FLAG_PROTO_GM) &&
+           PIM_I_am_DR(pim_ifp))
                return true;
 
        return false;
@@ -1025,14 +1047,14 @@ void pim_mroute_update_counters(struct channel_oil *c_oil)
 
        memset(&sgreq, 0, sizeof(sgreq));
 
+       pim_zlookup_sg_statistics(c_oil);
+
 #if PIM_IPV == 4
        sgreq.src = *oil_origin(c_oil);
        sgreq.grp = *oil_mcastgrp(c_oil);
-       pim_zlookup_sg_statistics(c_oil);
 #else
        sgreq.src = c_oil->oil.mf6cc_origin;
        sgreq.grp = c_oil->oil.mf6cc_mcastgrp;
-       /* TODO Zlookup_sg_statistics for V6 to be added */
 #endif
        if (ioctl(pim->mroute_socket, PIM_SIOCGETSGCNT, &sgreq)) {
                pim_sgaddr sg;