diff options
author | Emanuele Di Pascale <emanuele@voltanet.io> | 2019-01-18 12:39:28 +0100 |
---|---|---|
committer | Emanuele Di Pascale <emanuele@voltanet.io> | 2019-01-18 12:43:35 +0100 |
commit | 188823b0809f54158b9565d8284279c0ac12683d (patch) | |
tree | f2b7cf2dcc223a544e38eaf851aafcaddc0049b5 /ospfd | |
parent | Merge pull request #3625 from donaldsharp/clist_strlen (diff) | |
download | frr-188823b0809f54158b9565d8284279c0ac12683d.tar.xz frr-188823b0809f54158b9565d8284279c0ac12683d.zip |
ospfd: fix no virtual-link cmd
the command was not checking
correctly in all cases whether the virtual link existed. This caused
bugs in some corner cases, e.g. when two virtual links were created,
one of them was deleted, and the second one was reset with no
authentication - this would instead create a new virtual link with
the area in decimal format.
Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
Diffstat (limited to 'ospfd')
-rw-r--r-- | ospfd/ospf_vty.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/ospfd/ospf_vty.c b/ospfd/ospf_vty.c index 3ab9c018e..c1dc1f0d6 100644 --- a/ospfd/ospf_vty.c +++ b/ospfd/ospf_vty.c @@ -1205,14 +1205,17 @@ DEFUN (no_ospf_area_vlink, return CMD_WARNING_CONFIG_FAILED; } + vl_data = ospf_vl_lookup(ospf, area, vl_config.vl_peer); + if (!vl_data) { + vty_out(vty, "Virtual link does not exist\n"); + return CMD_WARNING_CONFIG_FAILED; + } + if (argc <= 5) { /* Basic VLink no command */ /* Thats all folks! - BUGS B. strikes again!!!*/ - if ((vl_data = ospf_vl_lookup(ospf, area, vl_config.vl_peer))) - ospf_vl_delete(ospf, vl_data); - + ospf_vl_delete(ospf, vl_data); ospf_area_check_free(ospf, vl_config.area_id); - return CMD_SUCCESS; } |