diff options
author | Quentin Young <qlyoung@cumulusnetworks.com> | 2019-05-17 23:38:31 +0200 |
---|---|---|
committer | Quentin Young <qlyoung@cumulusnetworks.com> | 2019-05-17 23:38:31 +0200 |
commit | ab059defe31ce23cc01aed66af8d26288b2e0011 (patch) | |
tree | a893592c2c37c4aab56d6c2f7faab88d31663685 /vrrpd/vrrp.c | |
parent | vrrpd: const vrrp_hash_key (diff) | |
download | frr-ab059defe31ce23cc01aed66af8d26288b2e0011.tar.xz frr-ab059defe31ce23cc01aed66af8d26288b2e0011.zip |
vrrpd: fix coverity warnings
* Suppress false positive on out of bounds access
* Suppress false positive on unchecked str2sockunion
* Remove self assignment
* Initialze struct msghdr to zero
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Diffstat (limited to 'vrrpd/vrrp.c')
-rw-r--r-- | vrrpd/vrrp.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/vrrpd/vrrp.c b/vrrpd/vrrp.c index ad09caf35..3d535cbfb 100644 --- a/vrrpd/vrrp.c +++ b/vrrpd/vrrp.c @@ -763,7 +763,7 @@ static void vrrp_send_advertisement(struct vrrp_router *r) const char *group = r->family == AF_INET ? VRRP_MCASTV4_GROUP_STR : VRRP_MCASTV6_GROUP_STR; - str2sockunion(group, &dest); + (void)str2sockunion(group, &dest); ssize_t sent = sendto(r->sock_tx, pkt, (size_t)pktsz, 0, &dest.sa, sockunion_sizeof(&dest)); @@ -969,7 +969,7 @@ static int vrrp_read(struct thread *thread) uint8_t control[64]; struct ipaddr src = {}; - struct msghdr m; + struct msghdr m = {}; struct iovec iov; iov.iov_base = r->ibuf; @@ -1384,7 +1384,6 @@ static void vrrp_change_state_backup(struct vrrp_router *r) */ static void vrrp_change_state_initialize(struct vrrp_router *r) { - r->vr->advertisement_interval = r->vr->advertisement_interval; r->master_adver_interval = 0; vrrp_recalculate_timers(r); |