summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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,