summaryrefslogtreecommitdiff
path: root/lib/mpls.h
diff options
context:
space:
mode:
authorRuss White <russ@riw.us>2017-07-10 15:05:13 -0400
committerGitHub <noreply@github.com>2017-07-10 15:05:13 -0400
commitbe2ddfff10343de8cb2e357f1052ffb2448ea830 (patch)
treec8694738b7b4b532d7db5a366e7f5bd534d7301a /lib/mpls.h
parent1e5e04888f54b85350117ef52776761506e1f983 (diff)
parent41e3491695029e917ad17991e4de43544aef523b (diff)
Merge pull request #733 from dwalton76/bgpd-ipv4-plus-label-misc3
bgpd: Install SAFI_LABELED_UNICAST routes in SAFI_UNICAST table
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 c963e55087..20315df7d6 100644
--- a/lib/mpls.h
+++ b/lib/mpls.h
@@ -80,8 +80,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