Modify mpls.h to rename MPLS_LABEL_ILLEGAL to be MPLS_LABEL_NONE.
Fix all pre-existing code that used MPLS_LABEL_ILLEGAL.
Modify the zapi vrf label message to use MPLS_LABEL_NONE as the
signal to remove label associated with a vrf.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
/* add to tail of list */
listnode_add(bgp->rfapi_cfg->nve_groups_sequential, rfg);
}
- rfg->label = MPLS_LABEL_ILLEGAL;
+ rfg->label = MPLS_LABEL_NONE;
QOBJ_REG(rfg, rfapi_nve_group_cfg);
return rfg;
vnc_redistribute_prechange(bgp);
}
- rfg->label = MPLS_LABEL_ILLEGAL;
+ rfg->label = MPLS_LABEL_NONE;
if (bgp->rfapi_cfg->rfg_redist == rfg) {
vnc_redistribute_postchange(bgp);
#define MPLS_LABEL_OAM_ALERT 14 /* [RFC3429] */
#define MPLS_LABEL_EXTENSION 15 /* [RFC7274] */
#define MPLS_LABEL_MAX 1048575
-#define MPLS_LABEL_ILLEGAL 0xFFFFFFFF /* for internal use only */
+#define MPLS_LABEL_NONE 0xFFFFFFFF /* for internal use only */
/* Minimum and maximum label values */
#define MPLS_LABEL_RESERVED_MIN 0
* Send to zebra that the specified vrf is using label to resolve
* itself for L3VPN's. Repeated calls of this function with
* different labels will cause an effective update of the
- * label for lookup. If you pass in MPLS_LABEL_IPV4_EXPLICIT_NULL
+ * label for lookup. If you pass in MPLS_LABEL_NONE
* we will cause a delete action and remove this label pop
* operation.
*/
return CMD_SUCCESS;
}
-DEFPY(vrf_label,
- vrf_label_cmd,
+DEFPY(vrf_label, vrf_label_cmd,
"sharp label vrf NAME$name label (0-100000)$label",
"Sharp Routing Protocol\n"
"Give a vrf a label\n"
VRF_CMD_HELP_STR
- "The label to use\n"
+ "The label to use, 0 specifies remove the label installed from previous\n"
"Specified range to use\n")
{
struct vrf *vrf;
return CMD_WARNING_CONFIG_FAILED;
}
+ if (label == 0)
+ label = MPLS_LABEL_NONE;
+
vrf_label_add(vrf->vrf_id, label);
return CMD_SUCCESS;
}
def_zvrf = zebra_vrf_lookup_by_id(VRF_DEFAULT);
- if (zvrf->label != MPLS_LABEL_IPV4_EXPLICIT_NULL)
+ if (zvrf->label != MPLS_LABEL_NONE)
mpls_lsp_uninstall(def_zvrf, ltype, zvrf->label,
NEXTHOP_TYPE_IFINDEX, NULL, ifp->ifindex);
- if (nlabel != MPLS_LABEL_IPV4_EXPLICIT_NULL)
+ if (nlabel != MPLS_LABEL_NONE)
mpls_lsp_install(def_zvrf, ltype, nlabel, MPLS_LABEL_IMPLICIT_NULL,
NEXTHOP_TYPE_IFINDEX, NULL, ifp->ifindex);