diff options
| author | Donald Sharp <donaldsharp72@gmail.com> | 2023-07-11 11:26:47 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-07-11 11:26:47 -0400 |
| commit | c8971388a9013ffb65b4de20fd1553f6e1e94311 (patch) | |
| tree | a26a27524b14cac4712af0f02b10df5509e24977 | |
| parent | f46dc78367ec9554696dd8ef0e5e57c6ff94cf81 (diff) | |
| parent | 4bd04364adb27e18052730a54ee9a85ae12386c2 (diff) | |
Merge pull request #13958 from opensourcerouting/fix/coverity
Coverity fixes
| -rw-r--r-- | zebra/interface.c | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/zebra/interface.c b/zebra/interface.c index 7df73e2980..989763d13c 100644 --- a/zebra/interface.c +++ b/zebra/interface.c @@ -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); } } |
