From a9b5987989f65d214b4d3747dec55adab388981d Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Tue, 13 Sep 2016 12:20:39 +0000 Subject: [PATCH] pimd: Start noticing where upstream state came from 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 --- pimd/pim_mroute.c | 3 ++- pimd/pim_upstream.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/pimd/pim_mroute.c b/pimd/pim_mroute.c index cf98f32c24..1bd1b4457e 100644 --- a/pimd/pim_mroute.c +++ b/pimd/pim_mroute.c @@ -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); diff --git a/pimd/pim_upstream.c b/pimd/pim_upstream.c index 24e45b576c..66c5268f98 100644 --- a/pimd/pim_upstream.c +++ b/pimd/pim_upstream.c @@ -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 -- 2.39.5