diff options
author | Donald Sharp <sharpd@cumulusnetworks.com> | 2018-02-01 00:24:06 +0100 |
---|---|---|
committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2018-02-09 02:31:37 +0100 |
commit | 70e98a7fe7296a1279c6b7142e57221f71ff3121 (patch) | |
tree | 77325f78eefb0c95c96d18f8f09fee296d55db35 /ldpd | |
parent | zebra: Cleanup mpls handling to allow a NEXTHOP_TYPE_IFINDEX (diff) | |
download | frr-70e98a7fe7296a1279c6b7142e57221f71ff3121.tar.xz frr-70e98a7fe7296a1279c6b7142e57221f71ff3121.zip |
*: Make code use a consisten definition of labels
Turns out we had 3 different ways to define labels
all of them overlapping with the same meanings.
Consolidate to 1. This one choosen is consistent
naming wise with what the *bsd and linux kernels
use.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'ldpd')
-rw-r--r-- | ldpd/labelmapping.c | 10 | ||||
-rw-r--r-- | ldpd/lde.c | 22 | ||||
-rw-r--r-- | ldpd/logmsg.c | 6 |
3 files changed, 21 insertions, 17 deletions
diff --git a/ldpd/labelmapping.c b/ldpd/labelmapping.c index 5662038a5..944f93331 100644 --- a/ldpd/labelmapping.c +++ b/ldpd/labelmapping.c @@ -320,9 +320,9 @@ recv_labelmessage(struct nbr *nbr, char *buf, uint16_t len, uint16_t type) /* do not accept invalid labels */ if (label > MPLS_LABEL_MAX || (label <= MPLS_LABEL_RESERVED_MAX && - label != MPLS_LABEL_IPV4NULL && - label != MPLS_LABEL_IPV6NULL && - label != MPLS_LABEL_IMPLNULL)) { + label != MPLS_LABEL_IPV4_EXPLICIT_NULL && + label != MPLS_LABEL_IPV6_EXPLICIT_NULL && + label != MPLS_LABEL_IMPLICIT_NULL)) { session_shutdown(nbr, S_BAD_TLV_VAL, msg.id, msg.type); goto err; @@ -396,7 +396,7 @@ recv_labelmessage(struct nbr *nbr, char *buf, uint16_t len, uint16_t type) case MAP_TYPE_PREFIX: switch (me->map.fec.prefix.af) { case AF_INET: - if (label == MPLS_LABEL_IPV6NULL) { + if (label == MPLS_LABEL_IPV6_EXPLICIT_NULL) { session_shutdown(nbr, S_BAD_TLV_VAL, msg.id, msg.type); goto err; @@ -405,7 +405,7 @@ recv_labelmessage(struct nbr *nbr, char *buf, uint16_t len, uint16_t type) goto next; break; case AF_INET6: - if (label == MPLS_LABEL_IPV4NULL) { + if (label == MPLS_LABEL_IPV4_EXPLICIT_NULL) { session_shutdown(nbr, S_BAD_TLV_VAL, msg.id, msg.type); goto err; diff --git a/ldpd/lde.c b/ldpd/lde.c index 63e1e3994..a70b97d06 100644 --- a/ldpd/lde.c +++ b/ldpd/lde.c @@ -702,20 +702,20 @@ lde_update_label(struct fec_node *fn) switch (fn->fec.type) { case FEC_TYPE_IPV4: if (!(ldeconf->ipv4.flags & F_LDPD_AF_EXPNULL)) - return (MPLS_LABEL_IMPLNULL); + return (MPLS_LABEL_IMPLICIT_NULL); if (lde_acl_check(ldeconf->ipv4.acl_label_expnull_for, AF_INET, (union ldpd_addr *)&fn->fec.u.ipv4.prefix, fn->fec.u.ipv4.prefixlen) != FILTER_PERMIT) - return (MPLS_LABEL_IMPLNULL); - return (MPLS_LABEL_IPV4NULL); + return (MPLS_LABEL_IMPLICIT_NULL); + return MPLS_LABEL_IPV4_EXPLICIT_NULL; case FEC_TYPE_IPV6: if (!(ldeconf->ipv6.flags & F_LDPD_AF_EXPNULL)) - return (MPLS_LABEL_IMPLNULL); + return (MPLS_LABEL_IMPLICIT_NULL); if (lde_acl_check(ldeconf->ipv6.acl_label_expnull_for, AF_INET6, (union ldpd_addr *)&fn->fec.u.ipv6.prefix, fn->fec.u.ipv6.prefixlen) != FILTER_PERMIT) - return (MPLS_LABEL_IMPLNULL); - return (MPLS_LABEL_IPV6NULL); + return (MPLS_LABEL_IMPLICIT_NULL); + return MPLS_LABEL_IPV6_EXPLICIT_NULL; default: fatalx("lde_update_label: unexpected fec type"); break; @@ -1522,11 +1522,15 @@ lde_change_egress_label(int af) /* explicitly withdraw all null labels */ RB_FOREACH(ln, nbr_tree, &lde_nbrs) { - lde_send_labelwithdraw_wcard(ln, MPLS_LABEL_IMPLNULL); + lde_send_labelwithdraw_wcard(ln, MPLS_LABEL_IMPLICIT_NULL); if (ln->v4_enabled) - lde_send_labelwithdraw_wcard(ln, MPLS_LABEL_IPV4NULL); + lde_send_labelwithdraw_wcard( + ln, + MPLS_LABEL_IPV4_EXPLICIT_NULL); if (ln->v6_enabled) - lde_send_labelwithdraw_wcard(ln, MPLS_LABEL_IPV6NULL); + lde_send_labelwithdraw_wcard( + ln, + MPLS_LABEL_IPV6_EXPLICIT_NULL); } /* update label of connected routes */ diff --git a/ldpd/logmsg.c b/ldpd/logmsg.c index c819b33b4..a9b066a3d 100644 --- a/ldpd/logmsg.c +++ b/ldpd/logmsg.c @@ -115,11 +115,11 @@ log_label(uint32_t label) case NO_LABEL: snprintf(buf, TF_LEN, "-"); break; - case MPLS_LABEL_IMPLNULL: + case MPLS_LABEL_IMPLICIT_NULL: snprintf(buf, TF_LEN, "imp-null"); break; - case MPLS_LABEL_IPV4NULL: - case MPLS_LABEL_IPV6NULL: + case MPLS_LABEL_IPV4_EXPLICIT_NULL: + case MPLS_LABEL_IPV6_EXPLICIT_NULL: snprintf(buf, TF_LEN, "exp-null"); break; default: |