Merge pull request #6029 from donaldsharp/coverity_pim

Coverity pim
This commit is contained in:
Donatas Abraitis 2020-03-21 15:03:28 +02:00 committed by GitHub
commit 07ab06a8ce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 5 deletions

View File

@ -85,9 +85,12 @@ int mlag_lib_decode_mlag_hdr(struct stream *s, struct mlag_msg *msg,
size_t *length)
{
#define LIB_MLAG_HDR_LENGTH 8
if (s == NULL || msg == NULL)
return -1;
*length = stream_get_endp(s);
if (s == NULL || msg == NULL || *length < LIB_MLAG_HDR_LENGTH)
if (*length < LIB_MLAG_HDR_LENGTH)
return -1;
*length -= LIB_MLAG_HDR_LENGTH;

View File

@ -961,7 +961,7 @@ static inline void pim_mroute_copy(struct mfcctl *oil,
static int pim_mroute_add(struct channel_oil *c_oil, const char *name)
{
struct pim_instance *pim = c_oil->pim;
struct mfcctl tmp_oil;
struct mfcctl tmp_oil = { {0} };
int err;
pim->mroute_add_last = pim_time_monotonic_sec();

View File

@ -253,8 +253,17 @@ static void pim_vxlan_orig_mr_up_del(struct pim_vxlan_sg *vxlan_sg)
/* if there are other references register the source
* for nht
*/
if (up)
pim_rpf_update(vxlan_sg->pim, up, NULL, __func__);
if (up) {
enum pim_rpf_result r;
r = pim_rpf_update(vxlan_sg->pim, up, NULL, __func__);
if (r == PIM_RPF_FAILURE) {
if (PIM_DEBUG_VXLAN)
zlog_debug(
"vxlan SG %s rpf_update failure",
vxlan_sg->sg_str);
}
}
}
}
@ -788,8 +797,8 @@ void pim_vxlan_sg_del(struct pim_instance *pim, struct prefix_sg *sg)
if (!vxlan_sg)
return;
pim_vxlan_sg_del_item(vxlan_sg);
hash_release(pim->vxlan.sg_hash, vxlan_sg);
pim_vxlan_sg_del_item(vxlan_sg);
}
/******************************* MLAG handling *******************************/