]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
BGP: Use implicit-NULL label when announcing MPLS routes with local next-hop
authorOndrej Zajicek (work) <santiago@crfreenet.org>
Sat, 30 Jun 2018 23:03:16 +0000 (01:03 +0200)
committerOndrej Zajicek (work) <santiago@crfreenet.org>
Sat, 30 Jun 2018 23:03:16 +0000 (01:03 +0200)
We currently cannot assing local labels, but we can still be LSP egress
router. Therefore when we announce labeled route with local next-hop, we
should announce implicit-NULL label instead of rejecting it completely.

proto/bgp/packets.c

index d67ef0b23d366e30507bfbb811078ada069bcf5b..c40b8ec25af42067eb7ea8f09574588382a19aa6 100644 (file)
@@ -875,7 +875,10 @@ bgp_update_next_hop_ip(struct bgp_export_state *s, eattr *a, ea_list **to)
 
       /* TODO: Use local MPLS assigned label */
       if (s->mpls)
-       bgp_unset_attr(to, s->pool, BA_MPLS_LABEL_STACK);
+      {
+       u32 implicit_null = BGP_MPLS_NULL;
+       bgp_set_attr_data(to, s->pool, BA_MPLS_LABEL_STACK, 0, &implicit_null, 4);
+      }
     }
   }