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 <sharpd@nvidia.com>
This commit is contained in:
Donald Sharp 2022-06-22 07:48:51 -04:00
parent 9d3de36d0d
commit 8b5153aab0

View File

@ -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