aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Herbert <tom@herbertland.com>2015-05-07 11:08:51 -0400
committerDavid S. Miller <davem@davemloft.net>2015-05-09 22:29:50 -0400
commit78f5b899195019f71f7593c604d75ca61658eae3 (patch)
tree6b97c54521d46419b6ed35ac2e8fd6ebc3e9a76d
parent7c0004d3960a3ebffc68c372dfd98c09d1c680eb (diff)
mpls: Change reserved label names to be consistent with netbsd
Since these are now visible to userspace it is nice to be consistent with BSD (sys/netmpls/mpls.h in netBSD). Signed-off-by: Tom Herbert <tom@herbertland.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--include/uapi/linux/mpls.h12
-rw-r--r--net/mpls/af_mpls.c18
2 files changed, 15 insertions, 15 deletions
diff --git a/include/uapi/linux/mpls.h b/include/uapi/linux/mpls.h
index 0fe6ea5a41d5..139d4dd1cab8 100644
--- a/include/uapi/linux/mpls.h
+++ b/include/uapi/linux/mpls.h
@@ -32,13 +32,13 @@ struct mpls_label {
32#define MPLS_LS_TTL_SHIFT 0 32#define MPLS_LS_TTL_SHIFT 0
33 33
34/* Reserved labels */ 34/* Reserved labels */
35#define MPLS_LABEL_IPV4_EXPLICIT_NULL 0 /* RFC3032 */ 35#define MPLS_LABEL_IPV4NULL 0 /* RFC3032 */
36#define MPLS_LABEL_ROUTER_ALERT 1 /* RFC3032 */ 36#define MPLS_LABEL_RTALERT 1 /* RFC3032 */
37#define MPLS_LABEL_IPV6_EXPLICIT_NULL 2 /* RFC3032 */ 37#define MPLS_LABEL_IPV6NULL 2 /* RFC3032 */
38#define MPLS_LABEL_IMPLICIT_NULL 3 /* RFC3032 */ 38#define MPLS_LABEL_IMPLNULL 3 /* RFC3032 */
39#define MPLS_LABEL_ENTROPY_INDICATOR 7 /* RFC6790 */ 39#define MPLS_LABEL_ENTROPY 7 /* RFC6790 */
40#define MPLS_LABEL_GAL 13 /* RFC5586 */ 40#define MPLS_LABEL_GAL 13 /* RFC5586 */
41#define MPLS_LABEL_OAM_ALERT 14 /* RFC3429 */ 41#define MPLS_LABEL_OAMALERT 14 /* RFC3429 */
42#define MPLS_LABEL_EXTENSION 15 /* RFC7274 */ 42#define MPLS_LABEL_EXTENSION 15 /* RFC7274 */
43 43
44#endif /* _UAPI_MPLS_H */ 44#endif /* _UAPI_MPLS_H */
diff --git a/net/mpls/af_mpls.c b/net/mpls/af_mpls.c
index b6eb7615960a..7b3f732269e4 100644
--- a/net/mpls/af_mpls.c
+++ b/net/mpls/af_mpls.c
@@ -647,7 +647,7 @@ int nla_get_labels(const struct nlattr *nla,
647 return -EINVAL; 647 return -EINVAL;
648 648
649 switch (dec.label) { 649 switch (dec.label) {
650 case MPLS_LABEL_IMPLICIT_NULL: 650 case MPLS_LABEL_IMPLNULL:
651 /* RFC3032: This is a label that an LSR may 651 /* RFC3032: This is a label that an LSR may
652 * assign and distribute, but which never 652 * assign and distribute, but which never
653 * actually appears in the encapsulation. 653 * actually appears in the encapsulation.
@@ -935,7 +935,7 @@ static int resize_platform_label_table(struct net *net, size_t limit)
935 } 935 }
936 936
937 /* In case the predefined labels need to be populated */ 937 /* In case the predefined labels need to be populated */
938 if (limit > MPLS_LABEL_IPV4_EXPLICIT_NULL) { 938 if (limit > MPLS_LABEL_IPV4NULL) {
939 struct net_device *lo = net->loopback_dev; 939 struct net_device *lo = net->loopback_dev;
940 rt0 = mpls_rt_alloc(lo->addr_len); 940 rt0 = mpls_rt_alloc(lo->addr_len);
941 if (!rt0) 941 if (!rt0)
@@ -945,7 +945,7 @@ static int resize_platform_label_table(struct net *net, size_t limit)
945 rt0->rt_via_table = NEIGH_LINK_TABLE; 945 rt0->rt_via_table = NEIGH_LINK_TABLE;
946 memcpy(rt0->rt_via, lo->dev_addr, lo->addr_len); 946 memcpy(rt0->rt_via, lo->dev_addr, lo->addr_len);
947 } 947 }
948 if (limit > MPLS_LABEL_IPV6_EXPLICIT_NULL) { 948 if (limit > MPLS_LABEL_IPV6NULL) {
949 struct net_device *lo = net->loopback_dev; 949 struct net_device *lo = net->loopback_dev;
950 rt2 = mpls_rt_alloc(lo->addr_len); 950 rt2 = mpls_rt_alloc(lo->addr_len);
951 if (!rt2) 951 if (!rt2)
@@ -973,15 +973,15 @@ static int resize_platform_label_table(struct net *net, size_t limit)
973 memcpy(labels, old, cp_size); 973 memcpy(labels, old, cp_size);
974 974
975 /* If needed set the predefined labels */ 975 /* If needed set the predefined labels */
976 if ((old_limit <= MPLS_LABEL_IPV6_EXPLICIT_NULL) && 976 if ((old_limit <= MPLS_LABEL_IPV6NULL) &&
977 (limit > MPLS_LABEL_IPV6_EXPLICIT_NULL)) { 977 (limit > MPLS_LABEL_IPV6NULL)) {
978 RCU_INIT_POINTER(labels[MPLS_LABEL_IPV6_EXPLICIT_NULL], rt2); 978 RCU_INIT_POINTER(labels[MPLS_LABEL_IPV6NULL], rt2);
979 rt2 = NULL; 979 rt2 = NULL;
980 } 980 }
981 981
982 if ((old_limit <= MPLS_LABEL_IPV4_EXPLICIT_NULL) && 982 if ((old_limit <= MPLS_LABEL_IPV4NULL) &&
983 (limit > MPLS_LABEL_IPV4_EXPLICIT_NULL)) { 983 (limit > MPLS_LABEL_IPV4NULL)) {
984 RCU_INIT_POINTER(labels[MPLS_LABEL_IPV4_EXPLICIT_NULL], rt0); 984 RCU_INIT_POINTER(labels[MPLS_LABEL_IPV4NULL], rt0);
985 rt0 = NULL; 985 rt0 = NULL;
986 } 986 }
987 987