summaryrefslogtreecommitdiffstats
path: root/bgpd/bgp_nexthop.c
diff options
context:
space:
mode:
authorDonatas Abraitis <donatas@opensourcerouting.org>2022-05-11 12:16:44 +0200
committerDonatas Abraitis <donatas@opensourcerouting.org>2022-05-11 13:08:47 +0200
commit6006b807b1a84d31611173b837fafcd96ba9d692 (patch)
tree08f25453328d8c408f1a8c658e4e6ef91005d4a7 /bgpd/bgp_nexthop.c
parentripd: Use correct usage of memcpy() when zeroing struct (diff)
downloadfrr-6006b807b1a84d31611173b837fafcd96ba9d692.tar.xz
frr-6006b807b1a84d31611173b837fafcd96ba9d692.zip
*: Properly use memset() when zeroing
Wrong: memset(&a, 0, sizeof(struct ...)); Good: memset(&a, 0, sizeof(a)); Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
Diffstat (limited to 'bgpd/bgp_nexthop.c')
-rw-r--r--bgpd/bgp_nexthop.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/bgpd/bgp_nexthop.c b/bgpd/bgp_nexthop.c
index de48c9751..c6043807d 100644
--- a/bgpd/bgp_nexthop.c
+++ b/bgpd/bgp_nexthop.c
@@ -560,7 +560,7 @@ bool bgp_nexthop_self(struct bgp *bgp, afi_t afi, uint8_t type,
return true;
if (new_afi == AF_INET && hashcount(bgp->tip_hash)) {
- memset(&tmp_tip, 0, sizeof(struct tip_addr));
+ memset(&tmp_tip, 0, sizeof(tmp_tip));
tmp_tip.addr = attr->nexthop;
if (attr->flag & ATTR_FLAG_BIT(BGP_ATTR_NEXT_HOP)) {