summaryrefslogtreecommitdiffstats
path: root/bgpd/rfapi
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@nvidia.com>2021-01-17 22:08:03 +0100
committerDonald Sharp <sharpd@nvidia.com>2021-01-18 15:06:49 +0100
commitf6e07e1bdf6c5d4dfbc4f8b5e9a42efe71c67243 (patch)
treecab7ee7c9c704058c3e65e713c42b4de6b069591 /bgpd/rfapi
parentzebra: Tell SA that we are intentionally ignoring the return (diff)
downloadfrr-f6e07e1bdf6c5d4dfbc4f8b5e9a42efe71c67243.tar.xz
frr-f6e07e1bdf6c5d4dfbc4f8b5e9a42efe71c67243.zip
bgpd: Use uint32_t for size value instead of int in ecommunity struct
The `struct ecommunity` structure is using an int for a size value. Let's switch it over to a uint32_t for size values since a size value for data can never be negative. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Diffstat (limited to 'bgpd/rfapi')
-rw-r--r--bgpd/rfapi/rfapi_import.c8
-rw-r--r--bgpd/rfapi/vnc_export_bgp.c2
2 files changed, 6 insertions, 4 deletions
diff --git a/bgpd/rfapi/rfapi_import.c b/bgpd/rfapi/rfapi_import.c
index 3d87b6354..b2732a40b 100644
--- a/bgpd/rfapi/rfapi_import.c
+++ b/bgpd/rfapi/rfapi_import.c
@@ -984,7 +984,7 @@ static int rfapiEcommunitiesMatchBeec(struct ecommunity *ecom,
int rfapiEcommunitiesIntersect(struct ecommunity *e1, struct ecommunity *e2)
{
- int i, j;
+ uint32_t i, j;
if (!e1 || !e2)
return 0;
@@ -1014,7 +1014,8 @@ int rfapiEcommunitiesIntersect(struct ecommunity *e1, struct ecommunity *e2)
int rfapiEcommunityGetLNI(struct ecommunity *ecom, uint32_t *lni)
{
if (ecom) {
- int i;
+ uint32_t i;
+
for (i = 0; i < ecom->size; ++i) {
uint8_t *p = ecom->val + (i * ECOMMUNITY_SIZE);
@@ -1034,7 +1035,8 @@ int rfapiEcommunityGetEthernetTag(struct ecommunity *ecom, uint16_t *tag_id)
struct bgp *bgp = bgp_get_default();
*tag_id = 0; /* default to untagged */
if (ecom) {
- int i;
+ uint32_t i;
+
for (i = 0; i < ecom->size; ++i) {
as_t as = 0;
int encode = 0;
diff --git a/bgpd/rfapi/vnc_export_bgp.c b/bgpd/rfapi/vnc_export_bgp.c
index 762cd2596..bc29f05ae 100644
--- a/bgpd/rfapi/vnc_export_bgp.c
+++ b/bgpd/rfapi/vnc_export_bgp.c
@@ -134,7 +134,7 @@ static void encap_attr_export_ce(struct attr *new, struct attr *orig,
static int getce(struct bgp *bgp, struct attr *attr, struct prefix *pfx_ce)
{
uint8_t *ecp;
- int i;
+ uint32_t i;
uint16_t localadmin = bgp->rfapi_cfg->resolve_nve_roo_local_admin;
for (ecp = attr->ecommunity->val, i = 0; i < attr->ecommunity->size;