From: Donald Sharp Date: Sat, 16 Jul 2016 12:27:24 +0000 (-0400) Subject: pimd: Make pim_upstream_switch non static X-Git-Tag: frr-3.0-branchpoint~64^2~10^2~368 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=7fcdfb34acd927d5ea15e871f6627385a3eac5d9;p=matthieu%2Ffrr.git pimd: Make pim_upstream_switch non static Allow pim_upstream_switch to be called from outside of pim_upstream.c Also change the assert to an if test to just correctly stop the timer. Signed-off-by: Donald Sharp --- diff --git a/pimd/pim_upstream.c b/pimd/pim_upstream.c index 3b533d27fe..a2f34d24e9 100644 --- a/pimd/pim_upstream.c +++ b/pimd/pim_upstream.c @@ -318,8 +318,9 @@ static void forward_off(struct pim_upstream *up) } /* scan iflist */ } -static void pim_upstream_switch(struct pim_upstream *up, - enum pim_upstream_state new_state) +void +pim_upstream_switch(struct pim_upstream *up, + enum pim_upstream_state new_state) { enum pim_upstream_state old_state = up->join_state; @@ -353,13 +354,11 @@ static void pim_upstream_switch(struct pim_upstream *up, up->source_addr, up->group_addr, 0 /* prune */); - zassert(up->t_join_timer); - THREAD_OFF(up->t_join_timer); + if (up->t_join_timer) + THREAD_OFF(up->t_join_timer); } - } - static struct pim_upstream *pim_upstream_new(struct in_addr source_addr, struct in_addr group_addr, struct interface *incoming) diff --git a/pimd/pim_upstream.h b/pimd/pim_upstream.h index 5e7d6114df..78206e8db7 100644 --- a/pimd/pim_upstream.h +++ b/pimd/pim_upstream.h @@ -155,5 +155,7 @@ void pim_upstream_start_register_stop_timer (struct pim_upstream *up, int null_r void pim_upstream_send_join (struct pim_upstream *up); +void pim_upstream_switch (struct pim_upstream *up, enum pim_upstream_state new_state); + const char *pim_upstream_state2str (struct pim_upstream *up); #endif /* PIM_UPSTREAM_H */