]> git.puffer.fish Git - matthieu/frr.git/commitdiff
pimd: Display oil_parent as a string name of the interface
authorDonald Sharp <sharpd@nvidia.com>
Tue, 12 Sep 2023 22:19:23 +0000 (18:19 -0400)
committerDonald Sharp <sharpd@nvidia.com>
Thu, 14 Sep 2023 15:45:29 +0000 (11:45 -0400)
When debugging and outputting the oil_parent() let's just
convert it to a string that is useful for people trying
to debug pim

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
pimd/pim_mroute.c
pimd/pim_oil.c
pimd/pim_zlookup.c

index b64fcdeb87237a14aadcda71c5c9544f13ae3543..089b0feb374009e123b3e65d483754dd3e5d6da7 100644 (file)
@@ -1276,10 +1276,15 @@ int pim_mroute_del(struct channel_oil *c_oil, const char *name)
        if (!c_oil->installed) {
                if (PIM_DEBUG_MROUTE) {
                        char buf[1000];
-                       zlog_debug(
-                               "%s %s: vifi %d for route is %s not installed, do not need to send del req. ",
-                               __FILE__, __func__, *oil_parent(c_oil),
-                               pim_channel_oil_dump(c_oil, buf, sizeof(buf)));
+                       struct interface *iifp =
+                               pim_if_find_by_vif_index(pim,
+                                                        *oil_parent(c_oil));
+
+                       zlog_debug("%s %s: incoming interface %s for route is %s not installed, do not need to send del req. ",
+                                  __FILE__, __func__,
+                                  iifp ? iifp->name : "Unknown",
+                                  pim_channel_oil_dump(c_oil, buf,
+                                                       sizeof(buf)));
                }
                return -2;
        }
index e1ec9b34a113fbbceeddfdc886c0f3d27274a92c..1ae87a1bb3e10d281b3cded0d259beb739cd391b 100644 (file)
@@ -286,13 +286,16 @@ int pim_channel_del_oif(struct channel_oil *channel_oil, struct interface *oif,
        --channel_oil->oil_size;
 
        if (PIM_DEBUG_MROUTE) {
-               zlog_debug(
-                       "%s(%s): (S,G)=(%pPAs,%pPAs): proto_mask=%u IIF:%d OIF=%s vif_index=%d",
-                       __func__, caller, oil_origin(channel_oil),
-                       oil_mcastgrp(channel_oil),
-                       proto_mask,
-                       *oil_parent(channel_oil), oif->name,
-                       pim_ifp->mroute_vif_index);
+               struct interface *iifp =
+                       pim_if_find_by_vif_index(pim_ifp->pim,
+                                                *oil_parent(channel_oil));
+
+
+               zlog_debug("%s(%s): (S,G)=(%pPAs,%pPAs): proto_mask=%u IIF:%s OIF=%s vif_index=%d",
+                          __func__, caller, oil_origin(channel_oil),
+                          oil_mcastgrp(channel_oil), proto_mask,
+                          iifp ? iifp->name : "Unknown", oif->name,
+                          pim_ifp->mroute_vif_index);
        }
 
        return 0;
index 05a72269d664c67be28b2ba2c05bc82d5104c97b..c9f4d7a5a10f503994bcd5ecb2db6b76e8d939a0 100644 (file)
@@ -502,9 +502,9 @@ int pim_zlookup_sg_statistics(struct channel_oil *c_oil)
        if (PIM_DEBUG_ZEBRA) {
                more.src = *oil_origin(c_oil);
                more.grp = *oil_mcastgrp(c_oil);
-               zlog_debug(
-                       "Sending Request for New Channel Oil Information%pSG VIIF %d(%s)",
-                       &more, *oil_parent(c_oil), c_oil->pim->vrf->name);
+               zlog_debug("Sending Request for New Channel Oil Information%pSG VIIF %d(%s:%s)",
+                          &more, *oil_parent(c_oil),
+                          ifp ? ifp->name : "Unknown", c_oil->pim->vrf->name);
        }
 
        if (!ifp)