phy: twl4030-usb: make runtime pm more reliable.
[firefly-linux-kernel-4.4.55.git] / net / mpls / af_mpls.c
index 9fdd94cba83e4949f51c3c96479f0937f6ec0333..954810c76a8650d87ec4bddc62fa5618e48c1341 100644 (file)
@@ -646,6 +646,15 @@ int nla_get_labels(const struct nlattr *nla,
                if ((dec.bos != bos) || dec.ttl || dec.tc)
                        return -EINVAL;
 
+               switch (dec.label) {
+               case LABEL_IMPLICIT_NULL:
+                       /* RFC3032: This is a label that an LSR may
+                        * assign and distribute, but which never
+                        * actually appears in the encapsulation.
+                        */
+                       return -EINVAL;
+               }
+
                label[i] = dec.label;
        }
        *labels = nla_labels;