]> git.puffer.fish Git - mirror/frr.git/commitdiff
bgpd: Register for label only the default instance
authorvivek <vivek@cumulusnetworks.com>
Thu, 10 Aug 2017 15:43:06 +0000 (08:43 -0700)
committerMitesh Kanjariya <mitesh@marvel-07.cumulusnetworks.com>
Thu, 17 Aug 2017 09:54:54 +0000 (02:54 -0700)
Ensure that the registration for the "in" label for a unicast prefix
is done only in the default instance. The zebra label manager as well
as other code in BGP only has support for assigning labels in the
default instance.

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
Ticket: CM-17110
Reviewed By: CCR-6588
Testing Done: Manual tests, mpls

bgpd/bgp_route.c

index 3a3da6fc4e5c93eb3213f7f13425e10755fc4a50..e9bf5743311ad6674be4d4b176b9bd8909056a19 100644 (file)
@@ -2044,11 +2044,12 @@ static wq_item_status bgp_process_main(struct work_queue *wq, void *data)
 
        /* Do we need to allocate or free labels?
         * Right now, since we only deal with per-prefix labels, it is not
-        * necessary
-        * to do this upon changes to best path except of the label index
-        * changes.
+        * necessary to do this upon changes to best path except if the label
+        * index changes.
+        * NOTE: This is only relevant for the default instance.
         */
-       if (safi == SAFI_UNICAST) {
+       if (bgp->inst_type == BGP_INSTANCE_TYPE_DEFAULT
+           && safi == SAFI_UNICAST) {
                if (new_select) {
                        if (!old_select
                            || bgp_label_index_differs(new_select, old_select)