diff options
author | Quentin Young <qlyoung@cumulusnetworks.com> | 2020-03-05 22:15:32 +0100 |
---|---|---|
committer | Quentin Young <qlyoung@cumulusnetworks.com> | 2020-03-05 22:15:32 +0100 |
commit | 340594a929d91387c620c17d89f6592984d6088f (patch) | |
tree | 566def7601b6fe075e9f2b99b089e22bb949f034 /bgpd/bgp_attr.c | |
parent | bgpd: correctly handle repeated SRv6 attributes (diff) | |
download | frr-340594a929d91387c620c17d89f6592984d6088f.tar.xz frr-340594a929d91387c620c17d89f6592984d6088f.zip |
bgpd: properly initialize SRv6 attributes
We were using XMALLOC for these, and only initializing the refcount to 0
on one of them. Let's just use XCALLOC instead...
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Diffstat (limited to '')
-rw-r--r-- | bgpd/bgp_attr.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/bgpd/bgp_attr.c b/bgpd/bgp_attr.c index ea8a2c97b..33466957b 100644 --- a/bgpd/bgp_attr.c +++ b/bgpd/bgp_attr.c @@ -2512,9 +2512,8 @@ static bgp_attr_parse_ret_t bgp_attr_psid_sub(uint8_t type, uint16_t length, return bgp_attr_malformed( args, BGP_NOTIFY_UPDATE_MAL_ATTR, args->total); } - attr->srv6_vpn = XMALLOC(MTYPE_BGP_SRV6_VPN, + attr->srv6_vpn = XCALLOC(MTYPE_BGP_SRV6_VPN, sizeof(struct bgp_attr_srv6_vpn)); - attr->srv6_vpn->refcnt = 0; attr->srv6_vpn->sid_flags = sid_flags; sid_copy(&attr->srv6_vpn->sid, &ipv6_sid); } @@ -2555,7 +2554,7 @@ static bgp_attr_parse_ret_t bgp_attr_psid_sub(uint8_t type, uint16_t length, return bgp_attr_malformed( args, BGP_NOTIFY_UPDATE_MAL_ATTR, args->total); } - attr->srv6_l3vpn = XMALLOC(MTYPE_BGP_SRV6_L3VPN, + attr->srv6_l3vpn = XCALLOC(MTYPE_BGP_SRV6_L3VPN, sizeof(struct bgp_attr_srv6_l3vpn)); attr->srv6_l3vpn->sid_flags = sid_flags; attr->srv6_l3vpn->endpoint_behavior = endpoint_behavior; |