summaryrefslogtreecommitdiff
path: root/pimd/pim_upstream.c
diff options
context:
space:
mode:
authorJafar Al-Gharaibeh <Jafaral@users.noreply.github.com>2017-03-08 08:59:07 -0600
committerGitHub <noreply@github.com>2017-03-08 08:59:07 -0600
commitbaf9c436222ef0901caf2ba694f87a2746ddcd02 (patch)
tree065defcca23e718bb9371f64240214ec2fae388f /pimd/pim_upstream.c
parent790c77ed025f2d71d0aed1f0183bbedbbc1799e6 (diff)
parentf849df457e512bec6c87fda1b21c8cdc0960924c (diff)
Merge pull request #262 from donaldsharp/pim_jp_fixesfrr-3.0-branchpoint
Pim jp fixes
Diffstat (limited to 'pimd/pim_upstream.c')
-rw-r--r--pimd/pim_upstream.c30
1 files changed, 18 insertions, 12 deletions
diff --git a/pimd/pim_upstream.c b/pimd/pim_upstream.c
index ce567824f2..4187635b19 100644
--- a/pimd/pim_upstream.c
+++ b/pimd/pim_upstream.c
@@ -166,7 +166,6 @@ pim_upstream_del(struct pim_upstream *up, const char *name)
if (up->ref_count >= 1)
return;
- join_timer_stop(up);
THREAD_OFF(up->t_ka_timer);
THREAD_OFF(up->t_rs_timer);
THREAD_OFF(up->t_msdp_reg_timer);
@@ -181,6 +180,9 @@ pim_upstream_del(struct pim_upstream *up, const char *name)
}
}
+ join_timer_stop(up);
+ up->rpf.source_nexthop.interface = NULL;
+
if (up->sg.src.s_addr != INADDR_ANY) {
wheel_remove_item (pim_upstream_sg_wheel, up);
notify_msdp = true;
@@ -252,7 +254,8 @@ static int on_join_timer(struct thread *t)
* Don't send the join if the outgoing interface is a loopback
* But since this might change leave the join timer running
*/
- if (!if_is_loopback (up->rpf.source_nexthop.interface))
+ if (up->rpf.source_nexthop.interface &&
+ !if_is_loopback (up->rpf.source_nexthop.interface))
pim_upstream_send_join (up);
join_timer_start(up);
@@ -276,17 +279,20 @@ static void join_timer_stop(struct pim_upstream *up)
void
join_timer_start(struct pim_upstream *up)
{
- struct pim_neighbor *nbr;
-
- nbr = pim_neighbor_find (up->rpf.source_nexthop.interface,
- up->rpf.rpf_addr.u.prefix4);
+ struct pim_neighbor *nbr = NULL;
- if (PIM_DEBUG_PIM_EVENTS) {
- zlog_debug("%s: starting %d sec timer for upstream (S,G)=%s",
- __PRETTY_FUNCTION__,
- qpim_t_periodic,
- up->sg_str);
- }
+ if (up->rpf.source_nexthop.interface)
+ {
+ nbr = pim_neighbor_find (up->rpf.source_nexthop.interface,
+ up->rpf.rpf_addr.u.prefix4);
+
+ if (PIM_DEBUG_PIM_EVENTS) {
+ zlog_debug("%s: starting %d sec timer for upstream (S,G)=%s",
+ __PRETTY_FUNCTION__,
+ qpim_t_periodic,
+ up->sg_str);
+ }
+ }
if (nbr)
pim_jp_agg_add_group (nbr->upstream_jp_agg, up, 1);