Loading include/uapi/linux/mpls.h +10 −0 Original line number Diff line number Diff line Loading @@ -31,4 +31,14 @@ struct mpls_label { #define MPLS_LS_TTL_MASK 0x000000FF #define MPLS_LS_TTL_SHIFT 0 /* Reserved labels */ #define MPLS_LABEL_IPV4_EXPLICIT_NULL 0 /* RFC3032 */ #define MPLS_LABEL_ROUTER_ALERT 1 /* RFC3032 */ #define MPLS_LABEL_IPV6_EXPLICIT_NULL 2 /* RFC3032 */ #define MPLS_LABEL_IMPLICIT_NULL 3 /* RFC3032 */ #define MPLS_LABEL_ENTROPY_INDICATOR 7 /* RFC6790 */ #define MPLS_LABEL_GAL 13 /* RFC5586 */ #define MPLS_LABEL_OAM_ALERT 14 /* RFC3429 */ #define MPLS_LABEL_EXTENSION 15 /* RFC7274 */ #endif /* _UAPI_MPLS_H */ net/mpls/af_mpls.c +9 −9 Original line number Diff line number Diff line Loading @@ -647,7 +647,7 @@ int nla_get_labels(const struct nlattr *nla, return -EINVAL; switch (dec.label) { case LABEL_IMPLICIT_NULL: case MPLS_LABEL_IMPLICIT_NULL: /* RFC3032: This is a label that an LSR may * assign and distribute, but which never * actually appears in the encapsulation. Loading Loading @@ -935,7 +935,7 @@ static int resize_platform_label_table(struct net *net, size_t limit) } /* In case the predefined labels need to be populated */ if (limit > LABEL_IPV4_EXPLICIT_NULL) { if (limit > MPLS_LABEL_IPV4_EXPLICIT_NULL) { struct net_device *lo = net->loopback_dev; rt0 = mpls_rt_alloc(lo->addr_len); if (!rt0) Loading @@ -945,7 +945,7 @@ static int resize_platform_label_table(struct net *net, size_t limit) rt0->rt_via_table = NEIGH_LINK_TABLE; memcpy(rt0->rt_via, lo->dev_addr, lo->addr_len); } if (limit > LABEL_IPV6_EXPLICIT_NULL) { if (limit > MPLS_LABEL_IPV6_EXPLICIT_NULL) { struct net_device *lo = net->loopback_dev; rt2 = mpls_rt_alloc(lo->addr_len); if (!rt2) Loading Loading @@ -973,15 +973,15 @@ static int resize_platform_label_table(struct net *net, size_t limit) memcpy(labels, old, cp_size); /* If needed set the predefined labels */ if ((old_limit <= LABEL_IPV6_EXPLICIT_NULL) && (limit > LABEL_IPV6_EXPLICIT_NULL)) { RCU_INIT_POINTER(labels[LABEL_IPV6_EXPLICIT_NULL], rt2); if ((old_limit <= MPLS_LABEL_IPV6_EXPLICIT_NULL) && (limit > MPLS_LABEL_IPV6_EXPLICIT_NULL)) { RCU_INIT_POINTER(labels[MPLS_LABEL_IPV6_EXPLICIT_NULL], rt2); rt2 = NULL; } if ((old_limit <= LABEL_IPV4_EXPLICIT_NULL) && (limit > LABEL_IPV4_EXPLICIT_NULL)) { RCU_INIT_POINTER(labels[LABEL_IPV4_EXPLICIT_NULL], rt0); if ((old_limit <= MPLS_LABEL_IPV4_EXPLICIT_NULL) && (limit > MPLS_LABEL_IPV4_EXPLICIT_NULL)) { RCU_INIT_POINTER(labels[MPLS_LABEL_IPV4_EXPLICIT_NULL], rt0); rt0 = NULL; } Loading net/mpls/internal.h +0 −10 Original line number Diff line number Diff line #ifndef MPLS_INTERNAL_H #define MPLS_INTERNAL_H #define LABEL_IPV4_EXPLICIT_NULL 0 /* RFC3032 */ #define LABEL_ROUTER_ALERT_LABEL 1 /* RFC3032 */ #define LABEL_IPV6_EXPLICIT_NULL 2 /* RFC3032 */ #define LABEL_IMPLICIT_NULL 3 /* RFC3032 */ #define LABEL_ENTROPY_INDICATOR 7 /* RFC6790 */ #define LABEL_GAL 13 /* RFC5586 */ #define LABEL_OAM_ALERT 14 /* RFC3429 */ #define LABEL_EXTENSION 15 /* RFC7274 */ struct mpls_shim_hdr { __be32 label_stack_entry; }; Loading Loading
include/uapi/linux/mpls.h +10 −0 Original line number Diff line number Diff line Loading @@ -31,4 +31,14 @@ struct mpls_label { #define MPLS_LS_TTL_MASK 0x000000FF #define MPLS_LS_TTL_SHIFT 0 /* Reserved labels */ #define MPLS_LABEL_IPV4_EXPLICIT_NULL 0 /* RFC3032 */ #define MPLS_LABEL_ROUTER_ALERT 1 /* RFC3032 */ #define MPLS_LABEL_IPV6_EXPLICIT_NULL 2 /* RFC3032 */ #define MPLS_LABEL_IMPLICIT_NULL 3 /* RFC3032 */ #define MPLS_LABEL_ENTROPY_INDICATOR 7 /* RFC6790 */ #define MPLS_LABEL_GAL 13 /* RFC5586 */ #define MPLS_LABEL_OAM_ALERT 14 /* RFC3429 */ #define MPLS_LABEL_EXTENSION 15 /* RFC7274 */ #endif /* _UAPI_MPLS_H */
net/mpls/af_mpls.c +9 −9 Original line number Diff line number Diff line Loading @@ -647,7 +647,7 @@ int nla_get_labels(const struct nlattr *nla, return -EINVAL; switch (dec.label) { case LABEL_IMPLICIT_NULL: case MPLS_LABEL_IMPLICIT_NULL: /* RFC3032: This is a label that an LSR may * assign and distribute, but which never * actually appears in the encapsulation. Loading Loading @@ -935,7 +935,7 @@ static int resize_platform_label_table(struct net *net, size_t limit) } /* In case the predefined labels need to be populated */ if (limit > LABEL_IPV4_EXPLICIT_NULL) { if (limit > MPLS_LABEL_IPV4_EXPLICIT_NULL) { struct net_device *lo = net->loopback_dev; rt0 = mpls_rt_alloc(lo->addr_len); if (!rt0) Loading @@ -945,7 +945,7 @@ static int resize_platform_label_table(struct net *net, size_t limit) rt0->rt_via_table = NEIGH_LINK_TABLE; memcpy(rt0->rt_via, lo->dev_addr, lo->addr_len); } if (limit > LABEL_IPV6_EXPLICIT_NULL) { if (limit > MPLS_LABEL_IPV6_EXPLICIT_NULL) { struct net_device *lo = net->loopback_dev; rt2 = mpls_rt_alloc(lo->addr_len); if (!rt2) Loading Loading @@ -973,15 +973,15 @@ static int resize_platform_label_table(struct net *net, size_t limit) memcpy(labels, old, cp_size); /* If needed set the predefined labels */ if ((old_limit <= LABEL_IPV6_EXPLICIT_NULL) && (limit > LABEL_IPV6_EXPLICIT_NULL)) { RCU_INIT_POINTER(labels[LABEL_IPV6_EXPLICIT_NULL], rt2); if ((old_limit <= MPLS_LABEL_IPV6_EXPLICIT_NULL) && (limit > MPLS_LABEL_IPV6_EXPLICIT_NULL)) { RCU_INIT_POINTER(labels[MPLS_LABEL_IPV6_EXPLICIT_NULL], rt2); rt2 = NULL; } if ((old_limit <= LABEL_IPV4_EXPLICIT_NULL) && (limit > LABEL_IPV4_EXPLICIT_NULL)) { RCU_INIT_POINTER(labels[LABEL_IPV4_EXPLICIT_NULL], rt0); if ((old_limit <= MPLS_LABEL_IPV4_EXPLICIT_NULL) && (limit > MPLS_LABEL_IPV4_EXPLICIT_NULL)) { RCU_INIT_POINTER(labels[MPLS_LABEL_IPV4_EXPLICIT_NULL], rt0); rt0 = NULL; } Loading
net/mpls/internal.h +0 −10 Original line number Diff line number Diff line #ifndef MPLS_INTERNAL_H #define MPLS_INTERNAL_H #define LABEL_IPV4_EXPLICIT_NULL 0 /* RFC3032 */ #define LABEL_ROUTER_ALERT_LABEL 1 /* RFC3032 */ #define LABEL_IPV6_EXPLICIT_NULL 2 /* RFC3032 */ #define LABEL_IMPLICIT_NULL 3 /* RFC3032 */ #define LABEL_ENTROPY_INDICATOR 7 /* RFC6790 */ #define LABEL_GAL 13 /* RFC5586 */ #define LABEL_OAM_ALERT 14 /* RFC3429 */ #define LABEL_EXTENSION 15 /* RFC7274 */ struct mpls_shim_hdr { __be32 label_stack_entry; }; Loading