summaryrefslogtreecommitdiffstats
path: root/bgpd/bgp_pbr.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_pbr.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_pbr.c')
-rw-r--r--bgpd/bgp_pbr.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/bgpd/bgp_pbr.c b/bgpd/bgp_pbr.c
index 352670e6c..7b5e28724 100644
--- a/bgpd/bgp_pbr.c
+++ b/bgpd/bgp_pbr.c
@@ -2679,9 +2679,9 @@ static void bgp_pbr_handle_entry(struct bgp *bgp, struct bgp_path_info *path,
struct bgp_pbr_val_mask bpvm;
memset(&range, 0, sizeof(range));
- memset(&nh, 0, sizeof(struct nexthop));
- memset(&bpf, 0, sizeof(struct bgp_pbr_filter));
- memset(&bpof, 0, sizeof(struct bgp_pbr_or_filter));
+ memset(&nh, 0, sizeof(nh));
+ memset(&bpf, 0, sizeof(bpf));
+ memset(&bpof, 0, sizeof(bpof));
if (api->match_bitmask & PREFIX_SRC_PRESENT ||
(api->type == BGP_PBR_IPRULE &&
api->match_bitmask_iprule & PREFIX_SRC_PRESENT))
@@ -2692,7 +2692,7 @@ static void bgp_pbr_handle_entry(struct bgp *bgp, struct bgp_path_info *path,
dst = &api->dst_prefix;
if (api->type == BGP_PBR_IPRULE)
bpf.type = api->type;
- memset(&nh, 0, sizeof(struct nexthop));
+ memset(&nh, 0, sizeof(nh));
nh.vrf_id = VRF_UNKNOWN;
if (api->match_protocol_num) {
proto = (uint8_t)api->protocol[0].value;