]> git.puffer.fish Git - mirror/frr.git/commit
lib: fix order of northbound callbacks 15403/head
authorIgor Ryzhov <iryzhov@nfware.com>
Tue, 20 Feb 2024 20:32:52 +0000 (22:32 +0200)
committerMergify <37929162+mergify[bot]@users.noreply.github.com>
Wed, 21 Feb 2024 08:02:18 +0000 (08:02 +0000)
commit424d6079326d5000c1f4b92584dea91bcb220b20
tree6d385d828e6157910fdab35c088e9129e71601f0
parent21af614945d9e309c6d1017d7d3ecaf28f42fb66
lib: fix order of northbound callbacks

When ordering the NB callbacks according to their priorities, if the
operation is "destroy" we should reverse the order, to destroy the
dependants before the dependencies.

This fixes the crash, that can be reproduced with the following steps:
```
frr# conf term file-lock
frr(config)# affinity-map map bit-position 10
frr(config)# interface test
frr(config-if)# link-params
frr(config-link-params)# affinity map
frr(config-link-params)# exit
frr(config-if)# exit
frr(config)# mgmt commit apply
frr(config)# no affinity-map map
frr(config)# interface test
frr(config-if)# link-params
frr(config-link-params)# no affinity map
frr(config-link-params)# exit
frr(config-if)# exit
frr(config)# mgmt commit apply
```

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
(cherry picked from commit 01f371a677dc52ff888b14360f6ffd63b91f3845)
lib/northbound.c