diff options
author | Dinesh G Dutt <5016467+ddutt@users.noreply.github.com> | 2019-08-13 18:28:16 +0200 |
---|---|---|
committer | Dinesh G Dutt <5016467+ddutt@users.noreply.github.com> | 2019-08-13 18:28:16 +0200 |
commit | eb4a93fb098a340e18cdfcfa4a2d1ebcf430ec83 (patch) | |
tree | 13536bbbe705b66622298e9638913cdda05ec5ea /zebra | |
parent | Merge pull request #1 from FRRouting/master (diff) | |
download | frr-eb4a93fb098a340e18cdfcfa4a2d1ebcf430ec83.tar.xz frr-eb4a93fb098a340e18cdfcfa4a2d1ebcf430ec83.zip |
zebra: Display master interface names, not ifindices
When displaying the master interface's information in "show interface",
the display is currently the ifindex of the master interface. Make it
display the name as well as that is more useful than the name.
Signed-off-by: Dinesh G Dutt<5016467+ddutt@users.noreply.github.com>
Diffstat (limited to 'zebra')
-rw-r--r-- | zebra/interface.c | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/zebra/interface.c b/zebra/interface.c index 732e900bb..a2f80aff4 100644 --- a/zebra/interface.c +++ b/zebra/interface.c @@ -1382,26 +1382,35 @@ static void if_dump_vty(struct vty *vty, struct interface *ifp) struct zebra_l2info_brslave *br_slave; br_slave = &zebra_if->brslave_info; - if (br_slave->bridge_ifindex != IFINDEX_INTERNAL) - vty_out(vty, " Master (bridge) ifindex %u\n", - br_slave->bridge_ifindex); + if (br_slave->bridge_ifindex != IFINDEX_INTERNAL) { + if (br_slave->br_if) + vty_out(vty, " Master interface: %s\n", + br_slave->br_if->name); + else + vty_out(vty, " Master ifindex: %u\n", + br_slave->bridge_ifindex); + } } if (IS_ZEBRA_IF_BOND_SLAVE(ifp)) { struct zebra_l2info_bondslave *bond_slave; bond_slave = &zebra_if->bondslave_info; - if (bond_slave->bond_ifindex != IFINDEX_INTERNAL) - vty_out(vty, " Master (bond) ifindex %u\n", - bond_slave->bond_ifindex); + if (bond_slave->bond_ifindex != IFINDEX_INTERNAL) { + if (bond_slave->bond_if) + vty_out(vty, " Master interface: %s\n", + bond_slave->bond_if->name); + else + vty_out(vty, " Master ifindex: %u\n", + bond_slave->bond_ifindex); + } } if (zebra_if->link_ifindex != IFINDEX_INTERNAL) { - vty_out(vty, " Link ifindex %u", zebra_if->link_ifindex); if (zebra_if->link) - vty_out(vty, "(%s)\n", zebra_if->link->name); + vty_out(vty, " Parent interface: %s\n", zebra_if->link->name); else - vty_out(vty, "(Unknown)\n"); + vty_out(vty, " Parent ifindex: %d\n", zebra_if->link_ifindex); } if (HAS_LINK_PARAMS(ifp)) { |