diff options
author | rgirada <rgirada@vmware.com> | 2020-12-23 10:13:17 +0100 |
---|---|---|
committer | rgirada <rgirada@vmware.com> | 2021-04-29 13:20:14 +0200 |
commit | 2fbb8f4543712088f01432172bd23b274c4db7f0 (patch) | |
tree | da229f430a97bde5e70cf0320684c1a66d16606a /ospfd/ospf_vty.c | |
parent | Merge pull request #8586 from volta-networks/fix_openbsd_doc (diff) | |
download | frr-2fbb8f4543712088f01432172bd23b274c4db7f0.tar.xz frr-2fbb8f4543712088f01432172bd23b274c4db7f0.zip |
ospfd: show ip ospf interface only shows BDR info, Added DR info.
Description:
DR information is missing under "show ip ospf interface [json]".
Added DR infomation to display in "show ip ospf interface".
Signed-off-by: Rajesh Girada <rgirada@vmware.com>
Diffstat (limited to 'ospfd/ospf_vty.c')
-rw-r--r-- | ospfd/ospf_vty.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/ospfd/ospf_vty.c b/ospfd/ospf_vty.c index 69a3e4587..57ef6029a 100644 --- a/ospfd/ospf_vty.c +++ b/ospfd/ospf_vty.c @@ -3737,6 +3737,31 @@ static void show_ip_ospf_interface_sub(struct vty *vty, struct ospf *ospf, vty_out(vty, " No backup designated router on this network\n"); } else { + nbr = ospf_nbr_lookup_by_addr(oi->nbrs, &DR(oi)); + if (nbr) { + if (use_json) { + json_object_string_add( + json_interface_sub, "drId", + inet_ntop(AF_INET, + &nbr->router_id, buf, + sizeof(buf))); + json_object_string_add( + json_interface_sub, "drAddress", + inet_ntop( + AF_INET, + &nbr->address.u.prefix4, + buf, sizeof(buf))); + } else { + vty_out(vty, + " Designated Router (ID) %pI4", + &nbr->router_id); + vty_out(vty, + " Interface Address %pFX\n", + &nbr->address); + } + } + nbr = NULL; + nbr = ospf_nbr_lookup_by_addr(oi->nbrs, &BDR(oi)); if (nbr == NULL) { if (!use_json) |