]> git.puffer.fish Git - mirror/frr.git/commitdiff
pimd: Start noticing where upstream state came from
authorDonald Sharp <sharpd@cumulusnetworks.com>
Tue, 13 Sep 2016 12:20:39 +0000 (12:20 +0000)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Thu, 22 Dec 2016 01:26:09 +0000 (20:26 -0500)
We need the ability to know where upstream state
comes from and to do the right thing from there.

ticket: CM-12771
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
pimd/pim_mroute.c
pimd/pim_upstream.c

index cf98f32c24363a1440ab1a604ccb18c6e9fcfc0a..1bd1b4457e0bfd59b76d71532481a5636bd9054a 100644 (file)
@@ -143,6 +143,7 @@ pim_mroute_msg_nocache (int fd, struct interface *ifp, const struct igmpmsg *msg
     }
     return 0;
   }
+  PIM_UPSTREAM_FLAG_SET_SRC_STREAM(up->flags);
 
   pim_upstream_keep_alive_timer_start (up, qpim_keep_alive_time);
 
@@ -361,7 +362,6 @@ pim_mroute_msg_wrvifwhole (int fd, struct interface *ifp, const char *buf)
   if (pim_if_connected_to_source (ifp, sg.src))
     {
       up = pim_upstream_add (&sg, ifp);
-
       if (!up)
        {
          if (PIM_DEBUG_MROUTE)
@@ -369,6 +369,7 @@ pim_mroute_msg_wrvifwhole (int fd, struct interface *ifp, const char *buf)
                        pim_str_sg_dump (&sg), ifp->name);
          return -2;
        }
+      PIM_UPSTREAM_FLAG_SET_SRC_STREAM(up->flags);
       PIM_UPSTREAM_FLAG_SET_FHR(up->flags);
 
       pim_upstream_keep_alive_timer_start (up, qpim_keep_alive_time);
index 24e45b576c92afb0ddd9e3c16c074537e3422407..66c5268f987fbf5617d79141ea884a0b3a14e7c5 100644 (file)
@@ -437,7 +437,7 @@ pim_upstream_switch(struct pim_upstream *up,
        if (pim_upstream_could_register (up))
          {
             PIM_UPSTREAM_FLAG_SET_FHR(up->flags);
-            if (!old_fhr)
+            if (!old_fhr && PIM_UPSTREAM_FLAG_TEST_SRC_STREAM(up->flags))
               {
                 pim_upstream_keep_alive_timer_start (up, qpim_keep_alive_time);
                pim_channel_add_oif (up->channel_oil, pim_regiface, PIM_OIF_FLAG_PROTO_PIM);
@@ -882,6 +882,7 @@ pim_upstream_keep_alive_timer (struct thread *t)
       THREAD_OFF (up->t_join_timer);
       pim_joinprune_send (up->rpf.source_nexthop.interface, up->rpf.rpf_addr.u.prefix4,
                           &up->sg, 0);
+      PIM_UPSTREAM_FLAG_UNSET_SRC_STREAM (up->flags);
       pim_upstream_del (up);
     }
   else