diff options
author | Donatas Abraitis <donatas@opensourcerouting.org> | 2022-05-11 12:16:44 +0200 |
---|---|---|
committer | Donatas Abraitis <donatas@opensourcerouting.org> | 2022-05-11 13:08:47 +0200 |
commit | 6006b807b1a84d31611173b837fafcd96ba9d692 (patch) | |
tree | 08f25453328d8c408f1a8c658e4e6ef91005d4a7 /bgpd/bgp_evpn_mh.c | |
parent | ripd: Use correct usage of memcpy() when zeroing struct (diff) | |
download | frr-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_evpn_mh.c')
-rw-r--r-- | bgpd/bgp_evpn_mh.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/bgpd/bgp_evpn_mh.c b/bgpd/bgp_evpn_mh.c index 6ce97d22c..a1c32403b 100644 --- a/bgpd/bgp_evpn_mh.c +++ b/bgpd/bgp_evpn_mh.c @@ -599,7 +599,7 @@ static void bgp_evpn_type4_route_extcomm_build(struct bgp_evpn_es *es, bgp_attr_set_ecommunity(attr, ecommunity_dup(&ecom_encap)); /* ES import RT */ - memset(&mac, 0, sizeof(struct ethaddr)); + memset(&mac, 0, sizeof(mac)); memset(&ecom_es_rt, 0, sizeof(ecom_es_rt)); es_get_system_mac(&es->esi, &mac); encode_es_rt_extcomm(&eval_es_rt, &mac); @@ -633,7 +633,7 @@ static int bgp_evpn_type4_route_update(struct bgp *bgp, struct bgp_dest *dest = NULL; struct bgp_path_info *pi = NULL; - memset(&attr, 0, sizeof(struct attr)); + memset(&attr, 0, sizeof(attr)); /* Build path-attribute for this route. */ bgp_attr_default_set(&attr, BGP_ORIGIN_IGP); @@ -943,7 +943,7 @@ static int bgp_evpn_type1_route_update(struct bgp *bgp, struct bgp_evpn_es *es, int route_changed = 0; struct prefix_rd *global_rd; - memset(&attr, 0, sizeof(struct attr)); + memset(&attr, 0, sizeof(attr)); /* Build path-attribute for this route. */ bgp_attr_default_set(&attr, BGP_ORIGIN_IGP); @@ -4507,7 +4507,7 @@ static struct bgp_evpn_nh *bgp_evpn_nh_add(struct bgp *bgp_vrf, struct bgp_evpn_nh tmp_n; struct bgp_evpn_nh *n = NULL; - memset(&tmp_n, 0, sizeof(struct bgp_evpn_nh)); + memset(&tmp_n, 0, sizeof(tmp_n)); memcpy(&tmp_n.ip, ip, sizeof(struct ipaddr)); n = hash_get(bgp_vrf->evpn_nh_table, &tmp_n, bgp_evpn_nh_alloc); ipaddr2str(ip, n->nh_str, sizeof(n->nh_str)); |