summaryrefslogtreecommitdiffstats
path: root/vrrpd/vrrp_ndisc.c
diff options
context:
space:
mode:
authorQuentin Young <qlyoung@cumulusnetworks.com>2019-05-17 23:38:31 +0200
committerQuentin Young <qlyoung@cumulusnetworks.com>2019-05-17 23:38:31 +0200
commitab059defe31ce23cc01aed66af8d26288b2e0011 (patch)
treea893592c2c37c4aab56d6c2f7faab88d31663685 /vrrpd/vrrp_ndisc.c
parentvrrpd: const vrrp_hash_key (diff)
downloadfrr-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_ndisc.c')
-rw-r--r--vrrpd/vrrp_ndisc.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/vrrpd/vrrp_ndisc.c b/vrrpd/vrrp_ndisc.c
index 8081533eb..348958509 100644
--- a/vrrpd/vrrp_ndisc.c
+++ b/vrrpd/vrrp_ndisc.c
@@ -139,7 +139,10 @@ static int vrrp_ndisc_una_build(struct interface *ifp, struct ipaddr *ip,
ph.dst = ip6h->ip6_dst;
ph.ulpl = htonl(len);
ph.next_hdr = IPPROTO_ICMPV6;
- icmp6h->icmp6_cksum = in_cksum_with_ph6(&ph, (void *)icmp6h, len);
+
+ /* Suppress static analysis warnings about accessing icmp6 oob */
+ void *offset = icmp6h;
+ icmp6h->icmp6_cksum = in_cksum_with_ph6(&ph, offset, len);
return 0;
}