From 8b5153aab09695f19eed74b141919487369b58c2 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Wed, 22 Jun 2022 07:48:51 -0400 Subject: [PATCH] bgpd: Cleanup pointer assignment so compiler doesn't get confused Coverity SA thinks that the `struct prefix`.u.prefix4 is limited to actually 4 bytes of memory at that spot, but it's in a union and it can be treated as a prefix6 as well. Just change the pointer assignment to something that covers both easily. Signed-off-by: Donald Sharp --- bgpd/rfapi/vnc_zebra.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/bgpd/rfapi/vnc_zebra.c b/bgpd/rfapi/vnc_zebra.c index 672a0e9780..293f88d1df 100644 --- a/bgpd/rfapi/vnc_zebra.c +++ b/bgpd/rfapi/vnc_zebra.c @@ -628,7 +628,6 @@ static void vnc_zebra_add_del_nve(struct bgp *bgp, struct rfapi_descriptor *rfd, struct rfapi_nve_group_cfg *rfg = rfd->rfg; afi_t afi = family2afi(rfd->vn_addr.addr_family); struct prefix nhp; - // struct prefix *nhpp; void *pAddr; vnc_zlog_debug_verbose("%s: entry, add=%d", __func__, add); @@ -660,7 +659,7 @@ static void vnc_zebra_add_del_nve(struct bgp *bgp, struct rfapi_descriptor *rfd, return; } - pAddr = &nhp.u.prefix4; + pAddr = &nhp.u.val; /* * Loop over the list of NVE-Groups configured for -- 2.39.5