Instruction related fixes
- Fixed PushHeaderInstructions bug, where half-baked Ethernet instace was used
only to hold ethernetType. (ONOS-987)
Change-Id: I330a862c8a18206250befbd4e22ee6d189beed83
diff --git a/core/api/src/main/java/org/onosproject/net/flow/instructions/Instructions.java b/core/api/src/main/java/org/onosproject/net/flow/instructions/Instructions.java
index df4a695..8141c9a 100644
--- a/core/api/src/main/java/org/onosproject/net/flow/instructions/Instructions.java
+++ b/core/api/src/main/java/org/onosproject/net/flow/instructions/Instructions.java
@@ -194,7 +194,7 @@
*/
public static Instruction pushMpls() {
return new PushHeaderInstructions(L2SubType.MPLS_PUSH,
- new Ethernet().setEtherType(Ethernet.MPLS_UNICAST));
+ Ethernet.MPLS_UNICAST);
}
/**
@@ -203,7 +203,7 @@
*/
public static Instruction popMpls() {
return new PushHeaderInstructions(L2SubType.MPLS_POP,
- new Ethernet().setEtherType(Ethernet.MPLS_UNICAST));
+ Ethernet.MPLS_UNICAST);
}
/**
@@ -214,8 +214,7 @@
*/
public static Instruction popMpls(Short etherType) {
checkNotNull(etherType, "Ethernet type cannot be null");
- return new PushHeaderInstructions(L2SubType.MPLS_POP,
- new Ethernet().setEtherType(etherType));
+ return new PushHeaderInstructions(L2SubType.MPLS_POP, etherType);
}
/*