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_debug.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_debug.c')
-rw-r--r-- | bgpd/bgp_debug.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/bgpd/bgp_debug.c b/bgpd/bgp_debug.c index 0993d6de5..ef71b191f 100644 --- a/bgpd/bgp_debug.c +++ b/bgpd/bgp_debug.c @@ -639,7 +639,7 @@ static int bgp_debug_parse_evpn_prefix(struct vty *vty, struct cmd_token **argv, return CMD_WARNING; if (evpn_type == BGP_EVPN_MAC_IP_ROUTE) { - memset(&ip, 0, sizeof(struct ipaddr)); + memset(&ip, 0, sizeof(ip)); argv_find(argv, argc, "mac", &mac_idx); (void)prefix_str2mac(argv[mac_idx + 1]->arg, &mac); @@ -650,7 +650,7 @@ static int bgp_debug_parse_evpn_prefix(struct vty *vty, struct cmd_token **argv, build_evpn_type2_prefix((struct prefix_evpn *)argv_p, &mac, &ip); } else if (evpn_type == BGP_EVPN_IMET_ROUTE) { - memset(&ip, 0, sizeof(struct ipaddr)); + memset(&ip, 0, sizeof(ip)); argv_find(argv, argc, "ip", &ip_idx); str2ipaddr(argv[ip_idx + 1]->arg, &ip); @@ -660,7 +660,7 @@ static int bgp_debug_parse_evpn_prefix(struct vty *vty, struct cmd_token **argv, } else if (evpn_type == BGP_EVPN_IP_PREFIX_ROUTE) { struct prefix ip_prefix; - memset(&ip_prefix, 0, sizeof(struct prefix)); + memset(&ip_prefix, 0, sizeof(ip_prefix)); if (argv_find(argv, argc, "ip", &ip_idx)) { (void)str2prefix(argv[ip_idx + 1]->arg, &ip_prefix); apply_mask(&ip_prefix); |