diff options
| author | Donald Sharp <sharpd@nvidia.com> | 2023-05-31 11:40:07 -0400 |
|---|---|---|
| committer | Mergify <37929162+mergify[bot]@users.noreply.github.com> | 2023-06-06 05:53:21 +0000 |
| commit | 9fd2155e60e8bb550823ed4823cc5ea19c0dc905 (patch) | |
| tree | 877c833f6b92a2515ddc9f66d1b2fa1eb15bf082 /zebra/zapi_msg.c | |
| parent | 298fe55a043a2ba978a10dcb4b9df214c72ccbca (diff) | |
zebra: Unlock the route node when sending route notifications
When using a context to send route notifications to upper
level protocols, the code was using a locking function to
get the route node. There is no need for this to be locked
as such FRR should free it up.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
(cherry picked from commit 82c6e4fea54eb65e153e6bc45bb718367b0b5132)
Diffstat (limited to 'zebra/zapi_msg.c')
| -rw-r--r-- | zebra/zapi_msg.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/zebra/zapi_msg.c b/zebra/zapi_msg.c index c0945eae2d..c84e5a250a 100644 --- a/zebra/zapi_msg.c +++ b/zebra/zapi_msg.c @@ -812,11 +812,17 @@ int zsend_route_notify_owner(const struct route_node *rn, int zsend_route_notify_owner_ctx(const struct zebra_dplane_ctx *ctx, enum zapi_route_notify_owner note) { - return (route_notify_internal( - rib_find_rn_from_ctx(ctx), dplane_ctx_get_type(ctx), - dplane_ctx_get_instance(ctx), dplane_ctx_get_vrf(ctx), - dplane_ctx_get_table(ctx), note, dplane_ctx_get_afi(ctx), - dplane_ctx_get_safi(ctx))); + int result; + struct route_node *rn = rib_find_rn_from_ctx(ctx); + + result = route_notify_internal( + rn, dplane_ctx_get_type(ctx), dplane_ctx_get_instance(ctx), + dplane_ctx_get_vrf(ctx), dplane_ctx_get_table(ctx), note, + dplane_ctx_get_afi(ctx), dplane_ctx_get_safi(ctx)); + + route_unlock_node(rn); + + return result; } static void zread_route_notify_request(ZAPI_HANDLER_ARGS) |
