]> git.puffer.fish Git - mirror/frr.git/commitdiff
pimd: Modify pim_upstream_state2str for more usage
authorDonald Sharp <sharpd@cumulusnetworks.com>
Fri, 19 Aug 2016 11:56:59 +0000 (07:56 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Thu, 22 Dec 2016 01:26:06 +0000 (20:26 -0500)
Just pass in the actual state to allow us to translate
the state to a string even if we don't have a upstream.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
pimd/pim_cmd.c
pimd/pim_upstream.c
pimd/pim_upstream.h

index 8067219e4586e0ae58f05a13c9165a54ff9791f3..ba2d4a063bd580fe2ed02280626fb913012439c8 100644 (file)
@@ -1004,7 +1004,7 @@ static void pim_show_upstream(struct vty *vty)
              up->rpf.source_nexthop.interface->name,
              src_str,
              grp_str,
-             pim_upstream_state2str (up),
+             pim_upstream_state2str (up->join_state),
              uptime,
              join_timer,
              rs_timer,
index 957cf456c16a5b35c47399e27d89a31ddfebd8a8..abc3f53c5697057dadcfb75b9ed633ba1ee30c8f 100644 (file)
@@ -175,7 +175,7 @@ pim_upstream_send_join (struct pim_upstream *up)
     char rpf_str[100];
     pim_inet4_dump("<rpf?>", up->rpf.rpf_addr, rpf_str, sizeof(rpf_str));
     zlog_debug ("%s: RPF'%s=%s(%s) for Interface %s", __PRETTY_FUNCTION__,
-               pim_str_sg_dump (&up->sg), rpf_str, pim_upstream_state2str (up),
+               pim_str_sg_dump (&up->sg), rpf_str, pim_upstream_state2str (up->join_state),
                up->rpf.source_nexthop.interface->name);
     if (PIM_INADDR_IS_ANY(up->rpf.rpf_addr)) {
       zlog_debug("%s: can't send join upstream: RPF'%s=%s",
@@ -379,10 +379,11 @@ pim_upstream_switch(struct pim_upstream *up,
   enum pim_upstream_state old_state = up->join_state;
 
   if (PIM_DEBUG_PIM_EVENTS) {
-    zlog_debug("%s: PIM_UPSTREAM_%s: (S,G)=%s",
+    zlog_debug("%s: PIM_UPSTREAM_%s: (S,G) old: %s new: %s",
               __PRETTY_FUNCTION__,
-              ((new_state == PIM_UPSTREAM_JOINED) ? "JOINED" : "NOTJOINED"),
-              pim_str_sg_dump (&up->sg));
+              pim_str_sg_dump (&up->sg),
+              pim_upstream_state2str (up->join_state),
+              pim_upstream_state2str (new_state));
   }
 
   /*
@@ -901,9 +902,9 @@ pim_upstream_switch_to_spt_desired (struct prefix_sg *sg)
 }
 
 const char *
-pim_upstream_state2str (struct pim_upstream *up)
+pim_upstream_state2str (enum pim_upstream_state join_state)
 {
-  switch (up->join_state)
+  switch (join_state)
     {
     case PIM_UPSTREAM_NOTJOINED:
       return "NtJnd";
@@ -936,7 +937,7 @@ pim_upstream_register_stop_timer (struct thread *t)
     {
       zlog_debug ("%s: (S,G)=%s upstream register stop timer %s",
                  __PRETTY_FUNCTION__, pim_str_sg_dump (&up->sg),
-                  pim_upstream_state2str(up));
+                  pim_upstream_state2str(up->join_state));
     }
 
   switch (up->join_state)
index fccb1c4186c402526dd9634bd05d616176384b0b..03dcd6bfd26bee9b632a06852eb4605f0170d6d6 100644 (file)
@@ -157,7 +157,7 @@ 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);
+const char *pim_upstream_state2str (enum pim_upstream_state join_state);
 
 int pim_upstream_inherited_olist (struct pim_upstream *up);
 #endif /* PIM_UPSTREAM_H */