diff options
| author | Donald Sharp <sharpd@cumulusnetworks.com> | 2017-03-06 12:56:32 -0500 |
|---|---|---|
| committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2017-03-08 08:37:53 -0500 |
| commit | fc9d070da4209c65cc65b56f9f936ab2d8e62e9c (patch) | |
| tree | fe411794bff1d828a5d87f7fe5357f33812d5456 /pimd/pim_upstream.c | |
| parent | 1a664f5e3685139651270263a6d65c868108264d (diff) | |
pimd: Fix various ifdown/ifup scenarios w/ J/P Agg
There exists situations where we may have cleaned not
properly cleaned up the various J/P aggregation lists.
This commit fixes those issues.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'pimd/pim_upstream.c')
| -rw-r--r-- | pimd/pim_upstream.c | 30 |
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); |
