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>
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);