Merge pull request #8278 from ckishimo/ospfv3_iface

ospf6d: fix iface commands lost when removing from area
This commit is contained in:
Donald Sharp 2021-03-20 20:11:16 -04:00 committed by GitHub
commit 6dfe243c38
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 8 deletions

View File

@ -1449,6 +1449,12 @@ DEFUN (show_ipv6_ospf6_interface_ifname_prefix,
return CMD_WARNING; return CMD_WARNING;
} }
if (CHECK_FLAG(oi->flag, OSPF6_INTERFACE_DISABLE)) {
vty_out(vty, "Interface %s not attached to area\n",
argv[idx_ifname]->arg);
return CMD_WARNING;
}
ospf6_route_table_show(vty, idx_prefix, argc, argv, oi->route_connected, ospf6_route_table_show(vty, idx_prefix, argc, argv, oi->route_connected,
uj); uj);
@ -1482,7 +1488,7 @@ DEFUN (show_ipv6_ospf6_interface_prefix,
FOR_ALL_INTERFACES (vrf, ifp) { FOR_ALL_INTERFACES (vrf, ifp) {
oi = (struct ospf6_interface *)ifp->info; oi = (struct ospf6_interface *)ifp->info;
if (oi == NULL) if (oi == NULL || CHECK_FLAG(oi->flag, OSPF6_INTERFACE_DISABLE))
continue; continue;
ospf6_route_table_show(vty, idx_prefix, argc, argv, ospf6_route_table_show(vty, idx_prefix, argc, argv,

View File

@ -809,7 +809,8 @@ DEFUN (no_ospf6_interface_area,
/* Verify Area */ /* Verify Area */
if (oi->area == NULL) { if (oi->area == NULL) {
vty_out(vty, "No such Area-ID: %s\n", argv[idx_ipv4]->arg); vty_out(vty, "%s not attached to area %s\n",
oi->interface->name, oi->area->name);
return CMD_SUCCESS; return CMD_SUCCESS;
} }
@ -830,7 +831,6 @@ DEFUN (no_ospf6_interface_area,
UNSET_FLAG(oa->flag, OSPF6_AREA_ENABLE); UNSET_FLAG(oa->flag, OSPF6_AREA_ENABLE);
ospf6_abr_disable_area(oa); ospf6_abr_disable_area(oa);
} }
ospf6_interface_delete(oi);
return CMD_SUCCESS; return CMD_SUCCESS;
} }

View File

@ -344,10 +344,9 @@ def config_ospf_interface(tgen, topo, input_dict=None, build=False, load_config=
for lnk in input_dict[router]["links"].keys(): for lnk in input_dict[router]["links"].keys():
if "ospf" not in input_dict[router]["links"][lnk]: if "ospf" not in input_dict[router]["links"][lnk]:
logger.debug( logger.debug(
"Router %s: ospf configs is not present in" "Router %s: ospf config is not present in"
"input_dict, passed input_dict", "input_dict",
router, router
input_dict,
) )
continue continue
ospf_data = input_dict[router]["links"][lnk]["ospf"] ospf_data = input_dict[router]["links"][lnk]["ospf"]
@ -724,7 +723,7 @@ def verify_ospf6_neighbor(tgen, topo):
nh_state = neighbor["state"] nh_state = neighbor["state"]
break break
else: else:
return "[DUT: {}] OSPF6 peer {} missing".format(router, data_rid) return "[DUT: {}] OSPF6 peer {} missing".format(router, ospf_nbr_rid)
if nh_state == "Full": if nh_state == "Full":
no_of_peer += 1 no_of_peer += 1