mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-14 14:17:20 +00:00
lib: Add labels_cmp to nexthop_cmp
Add labels comparison to nexthop_cmp() as well. Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
This commit is contained in:
parent
f932ce865f
commit
ff0e16daf9
@ -66,8 +66,9 @@ static int nexthop_labels_cmp(const struct nexthop *nh1,
|
|||||||
|
|
||||||
int nexthop_cmp(const struct nexthop *next1, const struct nexthop *next2)
|
int nexthop_cmp(const struct nexthop *next1, const struct nexthop *next2)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret = 0;
|
||||||
uint32_t n1, n2;
|
uint32_t n1 = 0;
|
||||||
|
uint32_2 n2 = 0;
|
||||||
|
|
||||||
if (next1->vrf_id < next2->vrf_id)
|
if (next1->vrf_id < next2->vrf_id)
|
||||||
return -1;
|
return -1;
|
||||||
@ -118,6 +119,10 @@ int nexthop_cmp(const struct nexthop *next1, const struct nexthop *next2)
|
|||||||
}
|
}
|
||||||
|
|
||||||
ret = memcmp(&next1->src, &next2->src, sizeof(union g_addr));
|
ret = memcmp(&next1->src, &next2->src, sizeof(union g_addr));
|
||||||
|
if (ret)
|
||||||
|
return ret;
|
||||||
|
|
||||||
|
ret = nexthop_labels_cmp(next1, next2);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user