diff options
| author | Philippe Guibert <philippe.guibert@6wind.com> | 2023-12-07 15:26:47 +0100 |
|---|---|---|
| committer | Philippe Guibert <philippe.guibert@6wind.com> | 2023-12-07 17:20:20 +0100 |
| commit | 4d60d9e2b4690bc0f1c84dd68b8b25c5c523e39a (patch) | |
| tree | d991e6f97703c0c3ef72b1164523ad75d550a69e /zebra/rib.h | |
| parent | 2648661ed50dd223a1c354bb85a67b762e5a1344 (diff) | |
zebra: enqueue NHG_DEL in rib_nhg meta queue
The NHG_DEL operation is done directly from ZAPI call, whereas
the NHG_ADD operation is done in the rib_nhg meta queue.
This may be problematic when ADD is followed by DEL. Imagine a
scenarion with two protocol NHIDs. <NH1> depends of <NH2> and
<NH3>. The deletion of <NH3> at the protocol level will trigger
2 messages to ZEBRA: NHG_ADD(<NH1>) and NHG_DEL(<NH3>).
Those operations are properly enqueued in ZAPI, but in the end,
the NHG_DEL is executed first. This causes NHG_ADD to unlink an
already freed NHG.
Fix this by consistently enqueuing NHG_DEL and NHG_ADD operations.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Diffstat (limited to 'zebra/rib.h')
| -rw-r--r-- | zebra/rib.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/zebra/rib.h b/zebra/rib.h index 7ce6fbe609..61d9953d81 100644 --- a/zebra/rib.h +++ b/zebra/rib.h @@ -430,6 +430,7 @@ extern int rib_queue_nhg_ctx_add(struct nhg_ctx *ctx); /* Enqueue incoming nhg from proto daemon for processing */ extern int rib_queue_nhe_add(struct nhg_hash_entry *nhe); +extern int rib_queue_nhe_del(struct nhg_hash_entry *nhe); /* Enqueue evpn route for processing */ int zebra_rib_queue_evpn_route_add(vrf_id_t vrf_id, const struct ethaddr *rmac, |
