From 9bf5f19cae44fcd2e9d9b243a81f7cd9be5c49ce Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Fri, 14 Jun 2019 19:01:46 -0400 Subject: [PATCH] pimd: Display ifp name in pim_channel_oil_dump The vifi being displayed is just confusing. Display the actual interface name being used in the mroute. Signed-off-by: Donald Sharp --- pimd/pim_oil.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/pimd/pim_oil.c b/pimd/pim_oil.c index 22045c2d33..033148ea9c 100644 --- a/pimd/pim_oil.c +++ b/pimd/pim_oil.c @@ -38,18 +38,22 @@ char *pim_channel_oil_dump(struct channel_oil *c_oil, char *buf, size_t size) { char *out; + struct interface *ifp; struct prefix_sg sg; int i; sg.src = c_oil->oil.mfcc_origin; sg.grp = c_oil->oil.mfcc_mcastgrp; - snprintf(buf, size, "%s IIF: %d, OIFS: ", pim_str_sg_dump(&sg), - c_oil->oil.mfcc_parent); + ifp = pim_if_find_by_vif_index(c_oil->pim, c_oil->oil.mfcc_parent); + snprintf(buf, size, "%s IIF: %s, OIFS: ", pim_str_sg_dump(&sg), + ifp ? ifp->name : "(?)"); out = buf + strlen(buf); for (i = 0; i < MAXVIFS; i++) { if (c_oil->oil.mfcc_ttls[i] != 0) { - snprintf(out, buf + size - out, "%d ", i); + ifp = pim_if_find_by_vif_index(c_oil->pim, i); + snprintf(out, buf + size - out, "%s ", + ifp ? ifp->name : "(?)"); out += strlen(out); } } -- 2.39.5