summaryrefslogtreecommitdiff
path: root/zebra/zebra_evpn_mac.c
diff options
context:
space:
mode:
authorDonatas Abraitis <donatas@opensourcerouting.org>2022-05-11 13:16:44 +0300
committerDonatas Abraitis <donatas@opensourcerouting.org>2022-05-11 14:08:47 +0300
commit6006b807b1a84d31611173b837fafcd96ba9d692 (patch)
tree08f25453328d8c408f1a8c658e4e6ef91005d4a7 /zebra/zebra_evpn_mac.c
parentf51eeb864bc821d92bd8e95670dde1258ed0747c (diff)
*: 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 'zebra/zebra_evpn_mac.c')
-rw-r--r--zebra/zebra_evpn_mac.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/zebra/zebra_evpn_mac.c b/zebra/zebra_evpn_mac.c
index 5a1f5af5d7..86364d08a0 100644
--- a/zebra/zebra_evpn_mac.c
+++ b/zebra/zebra_evpn_mac.c
@@ -1102,7 +1102,7 @@ struct zebra_mac *zebra_evpn_mac_add(struct zebra_evpn *zevpn,
struct zebra_mac tmp_mac;
struct zebra_mac *mac = NULL;
- memset(&tmp_mac, 0, sizeof(struct zebra_mac));
+ memset(&tmp_mac, 0, sizeof(tmp_mac));
memcpy(&tmp_mac.macaddr, macaddr, ETH_ALEN);
mac = hash_get(zevpn->mac_table, &tmp_mac, zebra_evpn_mac_alloc);
@@ -1255,7 +1255,7 @@ void zebra_evpn_mac_del_all(struct zebra_evpn *zevpn, int uninstall,
if (!zevpn->mac_table)
return;
- memset(&wctx, 0, sizeof(struct mac_walk_ctx));
+ memset(&wctx, 0, sizeof(wctx));
wctx.zevpn = zevpn;
wctx.uninstall = uninstall;
wctx.upd_client = upd_client;
@@ -1930,7 +1930,7 @@ void zebra_evpn_send_mac_list_to_client(struct zebra_evpn *zevpn)
if (!zevpn->mac_table)
return;
- memset(&wctx, 0, sizeof(struct mac_walk_ctx));
+ memset(&wctx, 0, sizeof(wctx));
wctx.zevpn = zevpn;
hash_iterate(zevpn->mac_table, zebra_evpn_send_mac_hash_entry_to_client,