summaryrefslogtreecommitdiff
path: root/bgpd/bgp_updgrp_packet.c
diff options
context:
space:
mode:
authorDaniel Walton <dwalton@cumulusnetworks.com>2017-06-16 19:12:57 +0000
committerDaniel Walton <dwalton@cumulusnetworks.com>2017-06-16 19:12:57 +0000
commit9bedbb1e52fbef082702723ee0a119d76a997ec8 (patch)
tree4732c6ea051da93c49e01910192226828e54781f /bgpd/bgp_updgrp_packet.c
parent62e4232010330e515630399838288f6281d04de6 (diff)
bgpd: Install SAFI_LABELED_UNICAST routes in SAFI_UNICAST table
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com> - All ipv4 labeled-unicast routes are now installed in the ipv4 unicast table. This allows us to do things like take routes from an ipv4 unicast peer, allocate a label for them and TX them to a ipv4 labeled-unicast peer. We can do the opposite where we take routes from a labeled-unicast peer, remove the label and advertise them to an ipv4 unicast peer. - Multipath over a labeled route and non-labeled route is not allowed. - You cannot activate a peer for both 'ipv4 unicast' and 'ipv4 labeled-unicast' - The 'tag' variable was overloaded for zebra's route tag feature as well as the mpls label. I added a 'mpls_label_t mpls' variable to avoid this. This is much cleaner but resulted in touching a lot of code.
Diffstat (limited to 'bgpd/bgp_updgrp_packet.c')
-rw-r--r--bgpd/bgp_updgrp_packet.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/bgpd/bgp_updgrp_packet.c b/bgpd/bgp_updgrp_packet.c
index 51abc19bea..1857d96833 100644
--- a/bgpd/bgp_updgrp_packet.c
+++ b/bgpd/bgp_updgrp_packet.c
@@ -785,26 +785,26 @@ subgroup_update_packet (struct update_subgroup *subgrp)
else
{
/* Encode the prefix in MP_REACH_NLRI attribute */
- u_char *tag = NULL;
+ mpls_label_t label = MPLS_INVALID_LABEL;
if (rn->prn)
prd = (struct prefix_rd *) &rn->prn->p;
if (safi == SAFI_LABELED_UNICAST)
- tag = bgp_adv_label(rn, binfo, peer, afi, safi);
+ label = bgp_adv_label(rn, binfo, peer, afi, safi);
else
if (binfo && binfo->extra)
- tag = binfo->extra->tag;
+ label = binfo->extra->label;
if (bgp_labeled_safi(safi))
- sprintf (label_buf, "label %u", label_pton(tag));
+ sprintf (label_buf, "label %u", label_pton(&label));
if (stream_empty (snlri))
mpattrlen_pos = bgp_packet_mpattr_start (snlri, peer, afi, safi,
&vecarr, adv->baa->attr);
bgp_packet_mpattr_prefix (snlri, afi, safi, &rn->p, prd,
- tag, addpath_encode, addpath_tx_id, adv->baa->attr);
+ &label, addpath_encode, addpath_tx_id, adv->baa->attr);
}
num_pfx++;