mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-07 17:18:56 +00:00
pimd: Display mroute uptime per (s,g) entry
Issue: show ip mroute displays the mroute uptime (time when mroute installed into the kernel) per oif. This is confusing. Fix: Display mroute uptime per (s,g) mroute entry. Signed-off-by: Sarita Patra <saritap@vmware.com>
This commit is contained in:
parent
b5a3c5ef9f
commit
dfd12d0255
@ -5399,6 +5399,7 @@ static void show_mroute(struct pim_instance *pim, struct vty *vty,
|
|||||||
int oif_vif_index;
|
int oif_vif_index;
|
||||||
struct interface *ifp_in;
|
struct interface *ifp_in;
|
||||||
char proto[100];
|
char proto[100];
|
||||||
|
char mroute_uptime[10];
|
||||||
|
|
||||||
if (uj) {
|
if (uj) {
|
||||||
json = json_object_new_object();
|
json = json_object_new_object();
|
||||||
@ -5434,6 +5435,10 @@ static void show_mroute(struct pim_instance *pim, struct vty *vty,
|
|||||||
else
|
else
|
||||||
strlcpy(in_ifname, "<iif?>", sizeof(in_ifname));
|
strlcpy(in_ifname, "<iif?>", sizeof(in_ifname));
|
||||||
|
|
||||||
|
|
||||||
|
pim_time_uptime(mroute_uptime, sizeof(mroute_uptime),
|
||||||
|
now - c_oil->mroute_creation);
|
||||||
|
|
||||||
if (uj) {
|
if (uj) {
|
||||||
|
|
||||||
/* Find the group, create it if it doesn't exist */
|
/* Find the group, create it if it doesn't exist */
|
||||||
@ -5467,13 +5472,14 @@ static void show_mroute(struct pim_instance *pim, struct vty *vty,
|
|||||||
json_object_int_add(json_source, "OilInheritedRescan",
|
json_object_int_add(json_source, "OilInheritedRescan",
|
||||||
c_oil->oil_inherited_rescan);
|
c_oil->oil_inherited_rescan);
|
||||||
json_object_string_add(json_source, "iif", in_ifname);
|
json_object_string_add(json_source, "iif", in_ifname);
|
||||||
|
json_object_string_add(json_source, "upTime",
|
||||||
|
mroute_uptime);
|
||||||
json_oil = NULL;
|
json_oil = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (oif_vif_index = 0; oif_vif_index < MAXVIFS;
|
for (oif_vif_index = 0; oif_vif_index < MAXVIFS;
|
||||||
++oif_vif_index) {
|
++oif_vif_index) {
|
||||||
struct interface *ifp_out;
|
struct interface *ifp_out;
|
||||||
char mroute_uptime[10];
|
|
||||||
int ttl;
|
int ttl;
|
||||||
|
|
||||||
ttl = c_oil->oil.mfcc_ttls[oif_vif_index];
|
ttl = c_oil->oil.mfcc_ttls[oif_vif_index];
|
||||||
@ -5491,9 +5497,6 @@ static void show_mroute(struct pim_instance *pim, struct vty *vty,
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
ifp_out = pim_if_find_by_vif_index(pim, oif_vif_index);
|
ifp_out = pim_if_find_by_vif_index(pim, oif_vif_index);
|
||||||
pim_time_uptime(
|
|
||||||
mroute_uptime, sizeof(mroute_uptime),
|
|
||||||
now - c_oil->mroute_creation);
|
|
||||||
found_oif = 1;
|
found_oif = 1;
|
||||||
|
|
||||||
if (ifp_out)
|
if (ifp_out)
|
||||||
@ -5579,6 +5582,7 @@ static void show_mroute(struct pim_instance *pim, struct vty *vty,
|
|||||||
src_str[0] = '\0';
|
src_str[0] = '\0';
|
||||||
grp_str[0] = '\0';
|
grp_str[0] = '\0';
|
||||||
in_ifname[0] = '\0';
|
in_ifname[0] = '\0';
|
||||||
|
mroute_uptime[0] = '\0';
|
||||||
first = 0;
|
first = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user