Skip to content

Commit

Permalink
ospfd:[clear] nv action clear should give error when there is no OSPF…
Browse files Browse the repository at this point in the history
… config

If ospf config is not applied on interface, clear ospf on that
interface should return error.
Ticket: #3942003

Signed-off-by: Manpreet Kaur <[email protected]>
  • Loading branch information
Manpreet-k0 authored and donaldsharp committed Dec 18, 2024
1 parent cfe4c61 commit 16dc582
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions ospfd/ospf_vty.c
Original file line number Diff line number Diff line change
Expand Up @@ -13474,8 +13474,14 @@ DEFUN (clear_ip_ospf_interface,
ifp = if_lookup_by_name(argv[idx_ifname]->arg, vrf_id);
if (ifp == NULL)
vty_out(vty, "No such interface name\n");
else
ospf_interface_clear(ifp);
else {
if (ospf_oi_count(ifp) == 0) {
vty_out(vty,
"OSPF not enabled on this interface\n");
} else {
ospf_interface_clear(ifp);
}
}
}

return CMD_SUCCESS;
Expand Down

0 comments on commit 16dc582

Please sign in to comment.