summaryrefslogtreecommitdiff
path: root/lib/mpls.h
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/mpls.h
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/mpls.h')
-rw-r--r--lib/mpls.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/mpls.h b/lib/mpls.h
index 6cf0142755..d78fcb1f57 100644
--- a/lib/mpls.h
+++ b/lib/mpls.h
@@ -76,8 +76,13 @@ typedef unsigned int mpls_lse_t;
/* MPLS label value as a 32-bit (mostly we only care about the label value). */
typedef unsigned int mpls_label_t;
-#define MPLS_NO_LABEL 0xFFFFFFFF
-#define MPLS_INVALID_LABEL 0xFFFFFFFF
+/* The MPLS explicit-null label is 0 which means when you memset a mpls_label_t
+ * to zero you have set that variable to explicit-null which was probably not
+ * your intent. The work-around is to use one bit to indicate if the
+ * mpls_label_t has been set by the user. MPLS_INVALID_LABEL has this bit clear
+ * so that we can use MPLS_INVALID_LABEL to initialize mpls_label_t variables.
+ */
+#define MPLS_INVALID_LABEL 0xFFFDFFFF
/* LSP types. */
enum lsp_types_t