diff options
| author | Donatas Abraitis <donatas.abraitis@gmail.com> | 2020-04-27 12:13:48 +0300 |
|---|---|---|
| committer | Donatas Abraitis <donatas.abraitis@gmail.com> | 2020-04-27 12:13:48 +0300 |
| commit | 7d16d76f4c5628aefd104d1a5bc97b1829a375e7 (patch) | |
| tree | 6b7f828cfc8907d7988eba24a896e4d9c3335693 /lib/zlog.h | |
| parent | 7351b9575423b665829fdaca76e0ffbbdf4e829e (diff) | |
lib: Delete the entire access-list only if there are no more entries
When you enter the access-list with the same sequence number but with a
different prefix AND access-list has only a single entry, then the entry
is deleted and the whole access-list is deleted.
That means that "replace entry" never be re-inserted.
With fix:
```
~# vtysh -c 'c' -c 'access-list 1 seq 10 permit 127.0.0.10/32'
~# vtysh -c 'sh run' | grep access-list
access-list 1 seq 10 permit 127.0.0.10/32
~# vtysh -c 'c' -c 'access-list 1 seq 10 permit 127.0.0.20/32'
~# vtysh -c 'sh run' | grep access-list
access-list 1 seq 10 permit 127.0.0.20/32
~# vtysh -c 'c' -c 'access-list 1 seq 11 permit 127.0.0.11/32'
~# vtysh -c 'sh run' | grep access-list
access-list 1 seq 10 permit 127.0.0.20/32
access-list 1 seq 11 permit 127.0.0.11/32
~# vtysh -c 'c' -c 'no access-list 1 seq 10 permit 127.0.0.20/32'
~# vtysh -c 'sh run' | grep access-list
access-list 1 seq 11 permit 127.0.0.11/32
~#
```
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
Diffstat (limited to 'lib/zlog.h')
0 files changed, 0 insertions, 0 deletions
