]> git.puffer.fish Git - matthieu/frr.git/commitdiff
zebra: Fix crash in pw code
authorDonald Sharp <sharpd@nvidia.com>
Wed, 9 Oct 2024 11:16:37 +0000 (07:16 -0400)
committerDonald Sharp <sharpd@nvidia.com>
Wed, 9 Oct 2024 11:17:29 +0000 (07:17 -0400)
Recent PR #17009 introduced a crash in pw handing
for deletion.  Let's fix that problem.

Fixes: #17041
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
zebra/zebra_pw.c

index c8ffaf0bbe36ba779bf6f684a7e1fd4a09d35ab7..6adc0b1b4aa526fdd0a8912a2f4de2308cba98d0 100644 (file)
@@ -205,9 +205,11 @@ void zebra_pw_handle_dplane_results(struct zebra_dplane_ctx *ctx)
        vrf = zebra_vrf_lookup_by_id(dplane_ctx_get_vrf(ctx));
        pw = zebra_pw_find(vrf, dplane_ctx_get_ifname(ctx));
 
+       if (!pw)
+               return;
+
        if (dplane_ctx_get_status(ctx) != ZEBRA_DPLANE_REQUEST_SUCCESS) {
-               if (pw)
-                       zebra_pw_install_failure(pw, dplane_ctx_get_pw_status(ctx));
+               zebra_pw_install_failure(pw, dplane_ctx_get_pw_status(ctx));
        } else {
                if (op == DPLANE_OP_PW_INSTALL && pw->status != PW_FORWARDING)
                        zebra_pw_update_status(pw, PW_FORWARDING);