summaryrefslogtreecommitdiff
path: root/lib/filter_nb.c
diff options
context:
space:
mode:
authorIgor Ryzhov <iryzhov@nfware.com>2024-02-23 21:14:26 +0200
committerIgor Ryzhov <iryzhov@nfware.com>2024-02-24 01:39:18 +0200
commit38b85e0c2bc555b8827dbd2cb6515b6febf548b4 (patch)
tree386d4ad5dc2b6d63bb913177fc1e6bf3e2e0b4aa /lib/filter_nb.c
parenteae228c52d4256542ab94038be263a29dbffa4ce (diff)
lib: fix order of northbound operations
When ordering operations, destroys must always come before other operations, to correctly cover the change of a "case" in a "choice". The problem can be reproduced with the following commands: ``` access-list test seq 1 permit 10.0.0.0/8 access-list test seq 1 permit host 10.0.0.1 access-list test seq 1 permit 10.0.0.0/8 ``` Before this commit, the order of changes would be the following: - `access-list test seq 1 permit 10.0.0.0/8` - `modify` for `ipv4-prefix` - `access-list test seq 1 permit host 10.0.0.1` - `destroy` for `ipv4-prefix` - `modify` for `host` - `access-list test seq 1 permit 10.0.0.0/8` - `modify` for `ipv4-prefix` - `destroy` for `host` As `destroy` for `host` is called last, it rewrites the fields that were filled by `modify` callback of `ipv4-prefix`. This commit fixes this problem by always calling `destroy` callbacks first. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
Diffstat (limited to 'lib/filter_nb.c')
0 files changed, 0 insertions, 0 deletions