case 6:\r
matchEntriesBuilder.setOxmMatchField(VlanVid.class);\r
VlanVidMatchEntryBuilder vlanVidBuilder = new VlanVidMatchEntryBuilder();\r
- int vidEntryValue = in.readUnsignedShort(); \r
- vlanVidBuilder.setCfiBit((vidEntryValue & 1) != 0);\r
- vlanVidBuilder.setVlanVid(vidEntryValue >> 1);\r
+ int vidEntryValue = in.readUnsignedShort();\r
+ vlanVidBuilder.setCfiBit((vidEntryValue & (1 << 12)) != 0); // cfi is 13-th bit\r
+ vlanVidBuilder.setVlanVid(vidEntryValue & ((1 << 12) - 1)); // value without 13-th bit\r
matchEntriesBuilder.addAugmentation(VlanVidMatchEntry.class, vlanVidBuilder.build());\r
if (hasMask) {\r
addMaskAugmentation(matchEntriesBuilder, in, EncodeConstants.SIZE_OF_SHORT_IN_BYTES);\r
fieldValue = 6;\r
fieldValue = fieldValue << 1;\r
VlanVidMatchEntry vlanVid = entry.getAugmentation(VlanVidMatchEntry.class);\r
- int vlanVidValue = vlanVid.getVlanVid() << 1;\r
+ int vlanVidValue = vlanVid.getVlanVid();\r
if (vlanVid.isCfiBit()) {\r
- vlanVidValue = vlanVidValue | 1;\r
+ short cfi = 1 << 12; // 13-th bit\r
+ vlanVidValue = vlanVidValue | cfi;\r
}\r
if (entry.isHasMask()) {\r
fieldValue = fieldValue | 1;\r