Merge pull request #7336 from donaldsharp/sharp_one_one

sharpd: Fix nexthop group name collision
This commit is contained in:
Donatas Abraitis 2020-10-17 20:31:22 +03:00 committed by GitHub
commit 0894afd4cf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -77,7 +77,8 @@ struct sharp_nhg {
uint32_t id; uint32_t id;
char name[256]; #define NHG_NAME_LEN 256
char name[NHG_NAME_LEN];
bool installed; bool installed;
}; };
@ -95,7 +96,7 @@ struct sharp_nhg_rb_head nhg_head;
static int sharp_nhg_compare_func(const struct sharp_nhg *a, static int sharp_nhg_compare_func(const struct sharp_nhg *a,
const struct sharp_nhg *b) const struct sharp_nhg *b)
{ {
return strncmp(a->name, b->name, strlen(a->name)); return strncmp(a->name, b->name, NHG_NAME_LEN);
} }
DECLARE_RBTREE_UNIQ(sharp_nhg_rb, struct sharp_nhg, mylistitem, DECLARE_RBTREE_UNIQ(sharp_nhg_rb, struct sharp_nhg, mylistitem,