OPNFLWPLUG-974: Message deserialization failed 50/68050/1
authorgobinath <gobinath@ericsson.com>
Sun, 4 Feb 2018 20:38:48 +0000 (02:08 +0530)
committerGobinath Suganthan <gobinath@ericsson.com>
Thu, 8 Feb 2018 04:51:06 +0000 (04:51 +0000)
Description:

"Message deserialization failed...msgType: 36864 oxm_field: 6
experimenterID: null was not found - please verify that all needed
deserializers ale loaded correctly".

Observation:

The deserialization of this message failed due to the msg type of one of
the oxm fields (CtMark) was getting decoded wrongly.

This was due to the CtMarkCodec present in the packet(before the Metadata
oxm field) was decoding the field wrongly. The field doesnt have mask field
in it but still the mask it was read, ie, it was reading the next oxm field bytes too(Metadata)
thereby skipping the bytes from which the oxm Metadata is supposed to be read
and hence wrong data(skipped 4 bytes) is decoded in the next oxm field deserialization.

Fix:

The incorrect read of mask field in Ctmark codec has been removed now.

Change-Id: I79b6899686b05217df533e9ef365e9909dfc048d
Signed-off-by: gobinath <gobinath@ericsson.com>
extension/openflowjava-extension-nicira/src/main/java/org/opendaylight/openflowjava/nx/codec/match/CtMarkCodec.java

index 7ced5422f0f333da562fa2374f7a1e3791c511b8..0e1ebe407e98549b41a06b6f06a330bf528712de 100755 (executable)
@@ -50,11 +50,12 @@ public class CtMarkCodec extends AbstractMatchCodec {
         MatchEntryBuilder matchEntryBuilder = deserializeHeaderToBuilder(message);
         CtMarkCaseValueBuilder caseBuilder = new CtMarkCaseValueBuilder();
         CtMarkValuesBuilder ctMarkValuesBuilder = new CtMarkValuesBuilder();
+        if (matchEntryBuilder.isHasMask()) {
+            ctMarkValuesBuilder.setMask(message.readUnsignedInt());
+        }
         ctMarkValuesBuilder.setCtMark(message.readUnsignedInt());
-        ctMarkValuesBuilder.setMask(message.readUnsignedInt());
         caseBuilder.setCtMarkValues(ctMarkValuesBuilder.build());
         matchEntryBuilder.setMatchEntryValue(caseBuilder.build());
-        matchEntryBuilder.setHasMask(true);
         return matchEntryBuilder.build();
     }