summaryrefslogtreecommitdiff
path: root/lib/nexthop.c
diff options
context:
space:
mode:
authorMark Stapp <mjs@voltanet.io>2021-04-07 10:08:46 -0400
committerMark Stapp <mjs@voltanet.io>2021-05-04 11:18:08 -0400
commit26dddc01a885c3d1369e124b84afa08af817d830 (patch)
treebb6b45a42ce8a78796c6a580bbcf94ed82df34b2 /lib/nexthop.c
parentf71e1ff6a98d0e244c7da11d870d14e31b517811 (diff)
lib: Fix label-stack comparison for nexthops
Use the correct number of octets in the comparison of nexthops' label stacks. Signed-off-by: Mark Stapp <mjs@voltanet.io>
Diffstat (limited to 'lib/nexthop.c')
-rw-r--r--lib/nexthop.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/nexthop.c b/lib/nexthop.c
index 8439398149..6b15442a87 100644
--- a/lib/nexthop.c
+++ b/lib/nexthop.c
@@ -62,7 +62,8 @@ static int _nexthop_labels_cmp(const struct nexthop *nh1,
if (nhl1->num_labels < nhl2->num_labels)
return -1;
- return memcmp(nhl1->label, nhl2->label, nhl1->num_labels);
+ return memcmp(nhl1->label, nhl2->label,
+ (nhl1->num_labels * sizeof(mpls_label_t)));
}
int nexthop_g_addr_cmp(enum nexthop_types_t type, const union g_addr *addr1,