From 6c3aae9c56a7321fe4b6a6272ab1758978bd2c96 Mon Sep 17 00:00:00 2001 From: anlan_cs Date: Tue, 25 Oct 2022 02:48:06 -0400 Subject: [PATCH] ospfd: fix missing max-metric in show running config ``` (ospf) max-metric router-lsa administrative ``` Currently this running config depends at least one `area` with *active* `network`, otherwise it will not occur. The check on this dependency is redundant and wrong, just remove it. Signed-off-by: anlan_cs --- ospfd/ospf_vty.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/ospfd/ospf_vty.c b/ospfd/ospf_vty.c index 4f0fa6194a..76dbc94c16 100644 --- a/ospfd/ospf_vty.c +++ b/ospfd/ospf_vty.c @@ -10532,22 +10532,15 @@ DEFUN (no_ospf_route_aggregation_timer, static void config_write_stub_router(struct vty *vty, struct ospf *ospf) { - struct listnode *ln; - struct ospf_area *area; - if (ospf->stub_router_startup_time != OSPF_STUB_ROUTER_UNCONFIGURED) vty_out(vty, " max-metric router-lsa on-startup %u\n", ospf->stub_router_startup_time); if (ospf->stub_router_shutdown_time != OSPF_STUB_ROUTER_UNCONFIGURED) vty_out(vty, " max-metric router-lsa on-shutdown %u\n", ospf->stub_router_shutdown_time); - for (ALL_LIST_ELEMENTS_RO(ospf->areas, ln, area)) { - if (CHECK_FLAG(area->stub_router_state, - OSPF_AREA_ADMIN_STUB_ROUTED)) { - vty_out(vty, " max-metric router-lsa administrative\n"); - break; - } - } + if (ospf->stub_router_admin_set == OSPF_STUB_ROUTER_ADMINISTRATIVE_SET) + vty_out(vty, " max-metric router-lsa administrative\n"); + return; } -- 2.39.5