]> git.puffer.fish Git - matthieu/frr.git/commitdiff
zebra: Add safi to some debugs
authorDonald Sharp <sharpd@nvidia.com>
Fri, 25 Oct 2024 19:44:34 +0000 (15:44 -0400)
committerDonald Sharp <sharpd@nvidia.com>
Wed, 30 Oct 2024 11:45:08 +0000 (07:45 -0400)
Trying to figure out what safi we are talking about is fun when
it is not put into the debugs.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
(cherry picked from commit 811168ecc3850a159fc22beaf30e42be63111413)

zebra/zebra_rib.c

index 8ebc193fba9997f9bb679cbcac33f948c9ea1bfe..9e937ba874930a0d95d09d67d2243735d0581e1d 100644 (file)
@@ -1204,8 +1204,15 @@ static void rib_process(struct route_node *rn)
        struct zebra_vrf *zvrf = NULL;
        struct vrf *vrf;
        struct route_entry *proto_re_changed = NULL;
-
        vrf_id_t vrf_id = VRF_UNKNOWN;
+       safi_t safi = SAFI_UNICAST;
+
+       if (IS_ZEBRA_DEBUG_RIB || IS_ZEBRA_DEBUG_RIB_DETAILED) {
+               struct rib_table_info *info = srcdest_rnode_table_info(rn);
+
+               assert(info);
+               safi = info->safi;
+       }
 
        assert(rn);
 
@@ -1231,9 +1238,8 @@ static void rib_process(struct route_node *rn)
        if (IS_ZEBRA_DEBUG_RIB_DETAILED) {
                struct route_entry *re = re_list_first(&dest->routes);
 
-               zlog_debug("%s(%u:%u):%pRN: Processing rn %p",
-                          VRF_LOGNAME(vrf), vrf_id, re->table, rn,
-                          rn);
+               zlog_debug("%s(%u:%u:%u):%pRN: Processing rn %p", VRF_LOGNAME(vrf), vrf_id,
+                          re->table, safi, rn, rn);
        }
 
        old_fib = dest->selected_fib;
@@ -1243,15 +1249,12 @@ static void rib_process(struct route_node *rn)
                        char flags_buf[128];
                        char status_buf[128];
 
-                       zlog_debug(
-                               "%s(%u:%u):%pRN: Examine re %p (%s) status: %sflags: %sdist %d metric %d",
-                               VRF_LOGNAME(vrf), vrf_id, re->table, rn, re,
-                               zebra_route_string(re->type),
-                               _dump_re_status(re, status_buf,
-                                               sizeof(status_buf)),
-                               zclient_dump_route_flags(re->flags, flags_buf,
-                                                        sizeof(flags_buf)),
-                               re->distance, re->metric);
+                       zlog_debug("%s(%u:%u:%u):%pRN: Examine re %p (%s) status: %sflags: %sdist %d metric %d",
+                                  VRF_LOGNAME(vrf), vrf_id, re->table, safi, rn, re,
+                                  zebra_route_string(re->type),
+                                  _dump_re_status(re, status_buf, sizeof(status_buf)),
+                                  zclient_dump_route_flags(re->flags, flags_buf, sizeof(flags_buf)),
+                                  re->distance, re->metric);
                }
 
                /* Currently selected re. */
@@ -1377,11 +1380,10 @@ static void rib_process(struct route_node *rn)
                                          : old_fib ? old_fib
                                                    : new_fib ? new_fib : NULL;
 
-               zlog_debug(
-                       "%s(%u:%u):%pRN: After processing: old_selected %p new_selected %p old_fib %p new_fib %p",
-                       VRF_LOGNAME(vrf), vrf_id, entry ? entry->table : 0, rn,
-                       (void *)old_selected, (void *)new_selected,
-                       (void *)old_fib, (void *)new_fib);
+               zlog_debug("%s(%u:%u:%u):%pRN: After processing: old_selected %p new_selected %p old_fib %p new_fib %p",
+                          VRF_LOGNAME(vrf), vrf_id, entry ? entry->table : 0, safi, rn,
+                          (void *)old_selected, (void *)new_selected, (void *)old_fib,
+                          (void *)new_fib);
        }
 
        /* Buffer ROUTE_ENTRY_CHANGED here, because it will get cleared if