MPLS-related bug fixes:
 - Use subtype() instead of type() inside method
   ModMplsLabelInstruction.toString()
 - Check whether the MPLS value is negative inside the MplsLabel()
   constructor.

Change-Id: I770194774219f0c919474928803e078226f2005d
diff --git a/core/api/src/main/java/org/onosproject/net/flow/instructions/L2ModificationInstruction.java b/core/api/src/main/java/org/onosproject/net/flow/instructions/L2ModificationInstruction.java
index 6147551..5135557 100644
--- a/core/api/src/main/java/org/onosproject/net/flow/instructions/L2ModificationInstruction.java
+++ b/core/api/src/main/java/org/onosproject/net/flow/instructions/L2ModificationInstruction.java
@@ -305,7 +305,7 @@
 
         @Override
         public String toString() {
-            return toStringHelper(type().toString())
+            return toStringHelper(subtype().toString())
                     .add("mpls", mplsLabel).toString();
         }
 
diff --git a/utils/misc/src/main/java/org/onlab/packet/MplsLabel.java b/utils/misc/src/main/java/org/onlab/packet/MplsLabel.java
index 631325e..1c84945 100644
--- a/utils/misc/src/main/java/org/onlab/packet/MplsLabel.java
+++ b/utils/misc/src/main/java/org/onlab/packet/MplsLabel.java
@@ -32,8 +32,10 @@
 
     public static MplsLabel mplsLabel(int value) {
 
-        if (value > MAX_MPLS) {
-            throw new IllegalArgumentException("value exceeds allowed maximum MPLS label value (0xFFFFF)");
+        if (value < 0 || value > MAX_MPLS) {
+            String errorMsg = "MPLS label value " + value +
+                " is not in the interval [0, 0xFFFFF]";
+            throw new IllegalArgumentException(errorMsg);
         }
         return new MplsLabel(value);
     }