Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vtysh freezed on ospf 'no network' command when there are multiple networks and interfaces (backport #14437) #14568

Merged
merged 1 commit into from
Oct 12, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions ospfd/ospfd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1257,8 +1257,9 @@ int ospf_network_unset(struct ospf *ospf, struct prefix_ipv4 *p,
{
struct route_node *rn;
struct ospf_network *network;
struct listnode *node, *nnode;
struct listnode *node;
struct ospf_interface *oi;
struct list *ospf_oiflist = NULL;

rn = route_node_lookup(ospf->networks, (struct prefix *)p);
if (rn == NULL)
Expand All @@ -1273,22 +1274,26 @@ int ospf_network_unset(struct ospf *ospf, struct prefix_ipv4 *p,
rn->info = NULL;
route_unlock_node(rn); /* initial reference */

/* Find interfaces that are not configured already. */
for (ALL_LIST_ELEMENTS(ospf->oiflist, node, nnode, oi)) {
ospf_oiflist = list_dup(ospf->oiflist);
/* Find interfaces that are not configured already. */
for (ALL_LIST_ELEMENTS_RO(ospf_oiflist, node, oi)) {

if (oi->type == OSPF_IFTYPE_VIRTUALLINK)
continue;

ospf_network_run_subnet(ospf, oi->connected, NULL, NULL);
}

list_delete(&ospf_oiflist);

/* Update connected redistribute. */
update_redistributed(ospf, 0); /* interfaces possibly removed */
ospf_area_check_free(ospf, area_id);

return 1;
}


/* Ensure there's an OSPF instance, as "ip ospf area" enabled OSPF means
* there might not be any 'router ospf' config.
*
Expand Down