Bug 7209 - Null Pointer Exception in LearnCodecUtil when add learn flow for ipv6
[openflowplugin.git] / extension / openflowjava-extension-nicira / src / main / java / org / opendaylight / openflowjava / nx / codec / action / LearnCodecUtil.java
index 0a08c8958bd3e893f917ab66209359608b33d3d0..01b3004cf030139e46497fea2b308649eeb73c01 100644 (file)
@@ -261,7 +261,7 @@ public class LearnCodecUtil {
 
     private static FlowMods readFlowModAddMatchFromValue(ByteBuf message, short numBits) {
         FlowModAddMatchFromValueBuilder builder = new FlowModAddMatchFromValueBuilder();
-        builder.setValue((int) message.readShort());
+        builder.setValue((int) message.readUnsignedShort());
         builder.setSrcField((long) message.readInt());
         builder.setSrcOfs((int) message.readShort());
         builder.setFlowModNumBits((int) numBits);
@@ -292,7 +292,7 @@ public class LearnCodecUtil {
 
     private static FlowMods readFlowModCopyFromValue(ByteBuf message, short numBits) {
         FlowModCopyValueIntoFieldBuilder builder = new FlowModCopyValueIntoFieldBuilder();
-        builder.setValue((int) message.readShort());
+        builder.setValue((int) message.readUnsignedShort());
         builder.setDstField((long) message.readInt());
         builder.setDstOfs((int) message.readShort());
         builder.setFlowModNumBits((int) numBits);