]> git.puffer.fish Git - matthieu/frr.git/commitdiff
pimd: Make pim_upstream_switch non static
authorDonald Sharp <sharpd@cumulusnetwroks.com>
Sat, 16 Jul 2016 12:27:24 +0000 (08:27 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Thu, 22 Dec 2016 01:26:02 +0000 (20:26 -0500)
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 <sharpd@cumulusnetworks.com>
pimd/pim_upstream.c
pimd/pim_upstream.h

index 3b533d27fe34865d5c0a816a2ebaea3f259f2514..a2f34d24e9306ebcb759e8a29951be7a58251a01 100644 (file)
@@ -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)
index 5e7d6114df7d8ffe096be81f6d457a29104a543e..78206e8db79f5829b685f08d5c248490e0d9ae55 100644 (file)
@@ -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 */