diff options
author | Robert Shearman <rshearma@brocade.com> | 2015-04-22 06:14:39 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-04-22 14:24:54 -0400 |
commit | 5a9ab0176198d91dfc153f5e6c5fdc5afa613607 (patch) | |
tree | e18ac4586481309da81bc43a30f3677e46a38858 /net | |
parent | 37bde79979c3862c79294c62ddcef7efc477e4bf (diff) |
mpls: Prevent use of implicit NULL label as outgoing label
The reserved implicit-NULL label isn't allowed to appear in the label
stack for packets, so make it an error for the control plane to
specify it as an outgoing label.
Suggested-by: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Robert Shearman <rshearma@brocade.com>
Reviewed-by: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/mpls/af_mpls.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/net/mpls/af_mpls.c b/net/mpls/af_mpls.c index 9fdd94cba83e..954810c76a86 100644 --- a/net/mpls/af_mpls.c +++ b/net/mpls/af_mpls.c | |||
@@ -646,6 +646,15 @@ int nla_get_labels(const struct nlattr *nla, | |||
646 | if ((dec.bos != bos) || dec.ttl || dec.tc) | 646 | if ((dec.bos != bos) || dec.ttl || dec.tc) |
647 | return -EINVAL; | 647 | return -EINVAL; |
648 | 648 | ||
649 | switch (dec.label) { | ||
650 | case LABEL_IMPLICIT_NULL: | ||
651 | /* RFC3032: This is a label that an LSR may | ||
652 | * assign and distribute, but which never | ||
653 | * actually appears in the encapsulation. | ||
654 | */ | ||
655 | return -EINVAL; | ||
656 | } | ||
657 | |||
649 | label[i] = dec.label; | 658 | label[i] = dec.label; |
650 | } | 659 | } |
651 | *labels = nla_labels; | 660 | *labels = nla_labels; |