Skip to content

Commit

Permalink
Merge pull request #10489 from FRRouting/mergify/bp/stable/8.1/pr-10485
Browse files Browse the repository at this point in the history
bgpd: strncmp -> strcmp in community hash foo (backport #10485)
  • Loading branch information
donaldsharp committed Feb 4, 2022
2 parents e518f42 + 6d5769a commit aaf0532
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions bgpd/bgp_community_alias.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,7 @@ static bool bgp_ca_community_hash_cmp(const void *p1, const void *p2)
const struct community_alias *ca1 = p1;
const struct community_alias *ca2 = p2;

return (strncmp(ca1->community, ca2->community,
sizeof(struct community_alias))
== 0);
return (strcmp(ca1->community, ca2->community) == 0);
}

static unsigned int bgp_ca_alias_hash_key(const void *p)
Expand All @@ -57,8 +55,7 @@ static bool bgp_ca_alias_hash_cmp(const void *p1, const void *p2)
const struct community_alias *ca1 = p1;
const struct community_alias *ca2 = p2;

return (strncmp(ca1->alias, ca2->alias, sizeof(struct community_alias))
== 0);
return (strcmp(ca1->alias, ca2->alias) == 0);
}

static void *bgp_community_alias_alloc(void *p)
Expand Down

0 comments on commit aaf0532

Please sign in to comment.