summaryrefslogtreecommitdiffstats
path: root/bgpd/bgp_attr.c
diff options
context:
space:
mode:
authorQuentin Young <qlyoung@cumulusnetworks.com>2020-03-05 22:15:32 +0100
committerQuentin Young <qlyoung@cumulusnetworks.com>2020-03-05 22:15:32 +0100
commit340594a929d91387c620c17d89f6592984d6088f (patch)
tree566def7601b6fe075e9f2b99b089e22bb949f034 /bgpd/bgp_attr.c
parentbgpd: correctly handle repeated SRv6 attributes (diff)
downloadfrr-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.c5
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;