ospfd: print administrative distance in show ip ospf

Signed-off-by: ckishimo <carles.kishimoto@gmail.com>
This commit is contained in:
ckishimo 2022-02-01 00:08:54 +01:00
parent 9fdb4735ad
commit f61b005a0b

View File

@ -3271,6 +3271,12 @@ static int show_ip_ospf_common(struct vty *vty, struct ospf *ospf,
/* Show refresh parameters. */
json_object_int_add(json_vrf, "refreshTimerMsecs",
ospf->lsa_refresh_interval * 1000);
/* show administrative distance */
json_object_int_add(json_vrf, "preference",
ospf->distance_all
? ospf->distance_all
: ZEBRA_OSPF_DISTANCE_DEFAULT);
} else {
vty_out(vty, " SPF timer %s%s\n",
(ospf->t_spf_calc ? "due in " : "is "),
@ -3293,6 +3299,11 @@ static int show_ip_ospf_common(struct vty *vty, struct ospf *ospf,
/* show max multipath */
vty_out(vty, " Maximum multiple paths(ECMP) supported %d\n",
ospf->max_multipath);
/* show administrative distance */
vty_out(vty, " Administrative distance %u\n",
ospf->distance_all ? ospf->distance_all
: ZEBRA_OSPF_DISTANCE_DEFAULT);
}
/* Show ABR/ASBR flags. */