bgpd, lib, sharpd, zebra: Use MPLS_LABEL_NONE

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>
This commit is contained in:
Donald Sharp 2018-02-08 10:19:34 -05:00
parent 339e36d258
commit 42567e0011
5 changed files with 11 additions and 9 deletions

View File

@ -554,7 +554,7 @@ rfapi_group_new(struct bgp *bgp, rfapi_group_cfg_type_t type, const char *name)
/* 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;
@ -3063,7 +3063,7 @@ DEFUN (vnc_vrf_policy_no_label,
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);

View File

@ -38,7 +38,7 @@
#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

View File

@ -387,7 +387,7 @@ extern void redist_del_instance(struct redist_proto *, u_short);
* 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.
*/

View File

@ -79,13 +79,12 @@ DEFPY (install_routes,
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;
@ -100,6 +99,9 @@ DEFPY(vrf_label,
return CMD_WARNING_CONFIG_FAILED;
}
if (label == 0)
label = MPLS_LABEL_NONE;
vrf_label_add(vrf->vrf_id, label);
return CMD_SUCCESS;
}

View File

@ -2518,11 +2518,11 @@ static void zread_vrf_label(struct zserv *client,
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);