]> git.puffer.fish Git - mirror/frr.git/commit
vtysh: return success from "no vrf" when VRF doesn't exist 6435/head
authorIgor Ryzhov <iryzhov@nfware.com>
Thu, 9 Jul 2020 16:20:32 +0000 (19:20 +0300)
committerIgor Ryzhov <iryzhov@nfware.com>
Thu, 9 Jul 2020 16:20:32 +0000 (19:20 +0300)
commitcd980d0375a45dc885a1781d00a6654e58f4396b
tree987fa667666b18d03df602970f499b0905921c91
parente6af96d598997fefbba744ef1dc2efe606279b3f
vtysh: return success from "no vrf" when VRF doesn't exist

It is possible that the same VRF exists in one daemon and doesn't exist
in another. In this case, "no vrf NAME" command execution will stop on
the first daemon without the VRF and it won't be possible to delete the
VRF from other daemons.

Such behavior can be reproduced with the following steps:
```
# ip link add test type vrf table 1
# vtysh -c "conf t" -c "vrf test" -c "ip route 1.1.1.1/32 blackhole"
# vtysh -c "show run"
...
vrf test
 ip route 1.1.1.1/32 blackhole
 exit-vrf
!
...
# ip link del test
# vtysh -c "conf t" -c "no vrf test"
% VRF test does not exist
# vtysh -c "show run"
...
vrf test
 ip route 1.1.1.1/32 blackhole
 exit-vrf
!
...
```

This commit fixes the issue by returning success from "no vrf" command
when VRF doesn't exist.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
lib/vrf.c