]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Nest: Handle non-MPLS on MPLS case in recursive route update
authorOndrej Zajicek (work) <santiago@crfreenet.org>
Thu, 10 Oct 2019 13:25:36 +0000 (15:25 +0200)
committerOndrej Zajicek (work) <santiago@crfreenet.org>
Thu, 10 Oct 2019 13:25:36 +0000 (15:25 +0200)
When non-MPLS recursive route resolves to MPLS underlying route,
then it should get MPLS labels from the the underlying route.

nest/rt-table.c

index d99953e52cda266cee10616fb1f720af48825396..0844070d7f6b954a35f0e3f9776f7fbf111aa9fd 100644 (file)
@@ -2115,6 +2115,7 @@ no_nexthop:
     memset(nhp, 0, NEXTHOP_MAX_SIZE);
     nhp->iface = nh->iface;
     nhp->weight = nh->weight;
+
     if (mls)
     {
       nhp->labels = nh->labels + mls->len;
@@ -2132,6 +2133,13 @@ no_nexthop:
        continue;
       }
     }
+    else if (nh->labels)
+    {
+      nhp->labels = nh->labels;
+      nhp->labels_orig = 0;
+      memcpy(nhp->label, nh->label, nh->labels * sizeof(u32));
+    }
+
     if (ipa_nonzero(nh->gw))
     {
       nhp->gw = nh->gw;                        /* Router nexthop */