Fix toward ONOS-960 - Signed/unsigned value mismatch for OpenFlow-related
match/action conditions
Fixed the signed/unsigned issue for the match conditions
Also:
* Reordered some of the code in CriterionCodec.java so the order
of handling various Criterion types follows the order as defined in
Criterion.java
- In the process, removed a duplicated entry for Type.MPLS_LABE
- Fixed an issue with TCP/UDP/SCTP ports being accessed as 8-bit integers
instead of 16-bit integers
* Updated some of the unit tests in CriterionCodecTest.java to use
larger integer values that could expose better potential bugs in
the tested code.
Change-Id: I531d13bd258ebc559ce6be716863c01613427a98
diff --git a/providers/openflow/flow/src/main/java/org/onosproject/provider/of/flow/impl/FlowModBuilder.java b/providers/openflow/flow/src/main/java/org/onosproject/provider/of/flow/impl/FlowModBuilder.java
index 076bfd6..15aa511 100644
--- a/providers/openflow/flow/src/main/java/org/onosproject/provider/of/flow/impl/FlowModBuilder.java
+++ b/providers/openflow/flow/src/main/java/org/onosproject/provider/of/flow/impl/FlowModBuilder.java
@@ -333,12 +333,12 @@
case ICMPV6_TYPE:
Icmpv6TypeCriterion icmpv6Type = (Icmpv6TypeCriterion) c;
mBuilder.setExact(MatchField.ICMPV6_TYPE,
- U8.of(icmpv6Type.icmpv6Type().byteValue()));
+ U8.of(icmpv6Type.icmpv6Type()));
break;
case ICMPV6_CODE:
Icmpv6CodeCriterion icmpv6Code = (Icmpv6CodeCriterion) c;
mBuilder.setExact(MatchField.ICMPV6_CODE,
- U8.of(icmpv6Code.icmpv6Code().byteValue()));
+ U8.of(icmpv6Code.icmpv6Code()));
break;
case IPV6_ND_TARGET:
IPv6NDTargetAddressCriterion targetAddressCriterion =
@@ -361,19 +361,19 @@
break;
case MPLS_LABEL:
Criteria.MplsCriterion mp = (Criteria.MplsCriterion) c;
- mBuilder.setExact(MatchField.MPLS_LABEL,
- U32.of(mp.label().intValue()));
+ mBuilder.setExact(MatchField.MPLS_LABEL, U32.of(mp.label()));
break;
case OCH_SIGID:
LambdaCriterion lc = (LambdaCriterion) c;
mBuilder.setExact(MatchField.OCH_SIGID,
- new CircuitSignalID((byte) 1, (byte) 2, lc.lambda(), (short) 1));
+ new CircuitSignalID((byte) 1, (byte) 2,
+ (short) lc.lambda(), (short) 1));
break;
case OCH_SIGTYPE:
Criteria.OpticalSignalTypeCriterion sc =
(Criteria.OpticalSignalTypeCriterion) c;
mBuilder.setExact(MatchField.OCH_SIGTYPE,
- U8.of(sc.signalType()));
+ U8.of((short) sc.signalType()));
break;
case ARP_OP:
case ARP_SHA: