]> git.ipfire.org Git - thirdparty/bird.git/commit
Nest: Fix locking of tables by channels
authorOndrej Zajicek <santiago@crfreenet.org>
Thu, 6 Mar 2025 02:43:15 +0000 (03:43 +0100)
committerOndrej Zajicek <santiago@crfreenet.org>
Thu, 6 Mar 2025 02:43:15 +0000 (03:43 +0100)
commit2679de7a39761385411d0e3d21a5d2e33085bd41
tree229b2ba923d909b8fb2d6166653404048a200472
parent377cfef1199004262d4e71ad170302d521461a5b
Nest: Fix locking of tables by channels

Channels that are down keep ptr on routing tables but do not keep them
locked. It is safe because the existence of tables depend on being
configured. But when a table is removed during reconfiguration, the
channel kept a dangling pointer since it fell down until it was removed.
This could be triggered by 'show protocols all' and other similar.

Change locking so that a channel kept a table locked for its whole
existence. The same change is already in BIRD 3.

Note that this is somewhat conceptually problematic as downed channels
do not keep resources. Also, other objects in specialized channels
(igp_table, base_table in bgp_channel, mpls_domain / mpls_range in
mpls_channel) are still locked only when channel is active, but for
them it is easier to keep track that they are not accessed when
they are deconfigured.
nest/proto.c
nest/protocol.h
proto/bgp/bgp.c