Merge pull request #13958 from opensourcerouting/fix/coverity

Coverity fixes
This commit is contained in:
Donald Sharp 2023-07-11 11:26:47 -04:00 committed by GitHub
commit c8971388a9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1373,6 +1373,13 @@ static void zebra_if_update_ctx(struct zebra_dplane_ctx *ctx,
bool pd_reason_val;
bool down;
if (!ifp) {
if (IS_ZEBRA_DEBUG_KERNEL)
zlog_debug("%s: Can't find ifp", __func__);
return;
}
dp_res = dplane_ctx_get_status(ctx);
pd_reason_val = dplane_ctx_get_intf_pd_reason_val(ctx);
down = dplane_ctx_intf_is_protodown(ctx);
@ -1449,7 +1456,7 @@ static void zebra_if_netconf_update_ctx(struct zebra_dplane_ctx *ctx,
linkdown_set = &zrouter.default_linkdownv6;
}
} else {
zif = ifp ? ifp->info : NULL;
zif = ifp->info;
if (!zif) {
if (IS_ZEBRA_DEBUG_KERNEL)
zlog_debug(
@ -1529,10 +1536,16 @@ static void interface_vrf_change(enum dplane_op_e op, ifindex_t ifindex,
if (exist_id != VRF_DEFAULT) {
vrf = vrf_lookup_by_id(exist_id);
flog_err(
EC_ZEBRA_VRF_MISCONFIGURED,
"VRF %s id %u table id overlaps existing vrf %s(%d), misconfiguration exiting",
name, ifindex, vrf->name, vrf->vrf_id);
if (vrf)
flog_err(EC_ZEBRA_VRF_MISCONFIGURED,
"VRF %s id %u table id overlaps existing vrf %s(%d), misconfiguration exiting",
name, ifindex, vrf->name,
vrf->vrf_id);
else
flog_err(EC_ZEBRA_VRF_NOT_FOUND,
"VRF %s id %u does not exist",
name, ifindex);
exit(-1);
}
}