]> git.proxmox.com Git - mirror_frr.git/blobdiff - vrrpd/vrrp_ndisc.c
Merge pull request #5793 from ton31337/fix/formatting_show_bgp_summary_failed
[mirror_frr.git] / vrrpd / vrrp_ndisc.c
index 8081533ebc5915fa8749bebecf77aa41ece10ef8..dc546b09a2cc4077420fff363dfbeee9ca32d85a 100644 (file)
@@ -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;
 }
@@ -211,8 +214,7 @@ int vrrp_ndisc_una_send_all(struct vrrp_router *r)
 
 void vrrp_ndisc_init(void)
 {
-       frr_elevate_privs(&vrrp_privs)
-       {
+       frr_with_privs(&vrrp_privs) {
                ndisc_fd = socket(AF_PACKET, SOCK_RAW, htons(ETH_P_IPV6));
        }