summaryrefslogtreecommitdiff
path: root/bgpd/bgp_label.c
diff options
context:
space:
mode:
Diffstat (limited to 'bgpd/bgp_label.c')
-rw-r--r--bgpd/bgp_label.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/bgpd/bgp_label.c b/bgpd/bgp_label.c
index 0f3faeb297..b8ce1ae467 100644
--- a/bgpd/bgp_label.c
+++ b/bgpd/bgp_label.c
@@ -195,7 +195,8 @@ int bgp_reg_for_label_callback(mpls_label_t new_label, void *labelid,
return -1;
}
- bgp_dest_unlock_node(dest);
+ dest = bgp_dest_unlock_node(dest);
+ assert(dest);
if (BGP_DEBUG(labelpool, LABELPOOL))
zlog_debug("%s: FEC %pRN label=%u, allocated=%d", __func__,
@@ -470,3 +471,20 @@ int bgp_nlri_parse_label(struct peer *peer, struct attr *attr,
return BGP_NLRI_PARSE_OK;
}
+
+bool bgp_labels_same(const mpls_label_t *tbl_a, const uint32_t num_labels_a,
+ const mpls_label_t *tbl_b, const uint32_t num_labels_b)
+{
+ uint32_t i;
+
+ if (num_labels_a != num_labels_b)
+ return false;
+ if (num_labels_a == 0)
+ return true;
+
+ for (i = 0; i < num_labels_a; i++) {
+ if (tbl_a[i] != tbl_b[i])
+ return false;
+ }
+ return true;
+}