]> git.proxmox.com Git - mirror_frr.git/blobdiff - pimd/pim_register.c
zebra: Allow ns delete to happen after under/over flow checks
[mirror_frr.git] / pimd / pim_register.c
index 9448dd8182c7430553d4854e4a33b3964fda87f0..b9908ae22be4ea5bbabee4b65f08624c170b82e1 100644 (file)
@@ -368,14 +368,37 @@ int pim_register_recv(struct interface *ifp, struct in_addr dest_addr,
                 */
                if (!upstream) {
                        upstream = pim_upstream_add(
-                               &sg, ifp, PIM_UPSTREAM_FLAG_MASK_SRC_STREAM,
-                               __PRETTY_FUNCTION__);
+                               pim_ifp->pim, &sg, ifp,
+                               PIM_UPSTREAM_FLAG_MASK_SRC_STREAM,
+                               __PRETTY_FUNCTION__, NULL);
                        if (!upstream) {
                                zlog_warn("Failure to create upstream state");
                                return 1;
                        }
 
                        upstream->upstream_register = src_addr;
+               } else {
+                       /*
+                        * If the FHR has set a very very fast register timer
+                        * there exists a possibility that the incoming NULL
+                        * register
+                        * is happening before we set the spt bit.  If so
+                        * Do a quick check to update the counters and
+                        * then set the spt bit as appropriate
+                        */
+                       if (upstream->sptbit != PIM_UPSTREAM_SPTBIT_TRUE) {
+                               pim_mroute_update_counters(
+                                       upstream->channel_oil);
+                               /*
+                                * Have we seen packets?
+                                */
+                               if (upstream->channel_oil->cc.oldpktcnt
+                                   < upstream->channel_oil->cc.pktcnt)
+                                       pim_upstream_set_sptbit(
+                                               upstream,
+                                               upstream->rpf.source_nexthop
+                                                       .interface);
+                       }
                }
 
                if ((upstream->sptbit == PIM_UPSTREAM_SPTBIT_TRUE)
@@ -394,10 +417,12 @@ int pim_register_recv(struct interface *ifp, struct in_addr dest_addr,
                    || (SwitchToSptDesired(pim_ifp->pim, &sg))) {
                        if (sentRegisterStop) {
                                pim_upstream_keep_alive_timer_start(
-                                       upstream, qpim_rp_keep_alive_time);
+                                       upstream,
+                                       pim_ifp->pim->rp_keep_alive_time);
                        } else {
                                pim_upstream_keep_alive_timer_start(
-                                       upstream, qpim_keep_alive_time);
+                                       upstream,
+                                       pim_ifp->pim->keep_alive_time);
                        }
                }