summaryrefslogtreecommitdiffstats
path: root/bgpd/bgp_community.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2018-10-17 21:27:12 +0200
committerDonald Sharp <sharpd@cumulusnetworks.com>2018-10-19 19:14:45 +0200
commit74df8d6d9d665784b0273151fe04cd2f9ff5b353 (patch)
tree7b0d38ba7c6e9605634d40a64c4b904295d59d80 /bgpd/bgp_community.c
parent*: Fixup to use proper list_cmp functions (diff)
downloadfrr-74df8d6d9d665784b0273151fe04cd2f9ff5b353.tar.xz
frr-74df8d6d9d665784b0273151fe04cd2f9ff5b353.zip
*: Replace hash_cmp function return value to a bool
The ->hash_cmp and linked list ->cmp functions were sometimes being used interchangeably and this really is not a good thing. So let's modify the hash_cmp function pointer to return a boolean and convert everything to use the new syntax. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'bgpd/bgp_community.c')
-rw-r--r--bgpd/bgp_community.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/bgpd/bgp_community.c b/bgpd/bgp_community.c
index e40674d63..9e5eb273a 100644
--- a/bgpd/bgp_community.c
+++ b/bgpd/bgp_community.c
@@ -614,17 +614,17 @@ int community_match(const struct community *com1, const struct community *com2)
/* If two aspath have same value then return 1 else return 0. This
function is used by hash package. */
-int community_cmp(const struct community *com1, const struct community *com2)
+bool community_cmp(const struct community *com1, const struct community *com2)
{
if (com1 == NULL && com2 == NULL)
- return 1;
+ return true;
if (com1 == NULL || com2 == NULL)
- return 0;
+ return false;
if (com1->size == com2->size)
if (memcmp(com1->val, com2->val, com1->size * 4) == 0)
- return 1;
- return 0;
+ return true;
+ return false;
}
/* Add com2 to the end of com1. */
@@ -902,7 +902,7 @@ void community_init(void)
{
comhash =
hash_create((unsigned int (*)(void *))community_hash_make,
- (int (*)(const void *, const void *))community_cmp,
+ (bool (*)(const void *, const void *))community_cmp,
"BGP Community Hash");
}