summaryrefslogtreecommitdiff
path: root/lib/stream.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 /lib/stream.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 'lib/stream.c')
-rw-r--r--lib/stream.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/stream.c b/lib/stream.c
index e8320a8fa1..6163a5b3ec 100644
--- a/lib/stream.c
+++ b/lib/stream.c
@@ -920,9 +920,10 @@ stream_put_prefix (struct stream *s, struct prefix *p)
/* Put NLRI with label */
int
-stream_put_labeled_prefix (struct stream *s, struct prefix *p, u_char *label)
+stream_put_labeled_prefix (struct stream *s, struct prefix *p, mpls_label_t *label)
{
size_t psize;
+ u_char *label_pnt = (u_char *) label;
STREAM_VERIFY_SANE(s);
@@ -935,9 +936,9 @@ stream_put_labeled_prefix (struct stream *s, struct prefix *p, u_char *label)
}
stream_putc (s, (p->prefixlen + 24));
- stream_putc(s, label[0]);
- stream_putc(s, label[1]);
- stream_putc(s, label[2]);
+ stream_putc(s, label_pnt[0]);
+ stream_putc(s, label_pnt[1]);
+ stream_putc(s, label_pnt[2]);
memcpy (s->data + s->endp, &p->u.prefix, psize);
s->endp += psize;