]> git.puffer.fish Git - matthieu/frr.git/commit
zebra: enqueue NHG_DEL in rib_nhg meta queue
authorPhilippe Guibert <philippe.guibert@6wind.com>
Thu, 7 Dec 2023 14:26:47 +0000 (15:26 +0100)
committerPhilippe Guibert <philippe.guibert@6wind.com>
Thu, 7 Dec 2023 16:20:20 +0000 (17:20 +0100)
commit4d60d9e2b4690bc0f1c84dd68b8b25c5c523e39a
treed991e6f97703c0c3ef72b1164523ad75d550a69e
parent2648661ed50dd223a1c354bb85a67b762e5a1344
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>
zebra/rib.h
zebra/zapi_msg.c
zebra/zebra_rib.c