Merge "Fixed padding issue with set-field action."
[openflowjava.git] / openflow-protocol-impl / src / main / java / org / opendaylight / openflowjava / protocol / impl / util / ActionsSerializer.java
index b635567806f76af612f59539600323e9c811a108..4bbd1273a9066f9c93e63a12b2a0819a45622082 100644 (file)
@@ -222,7 +222,9 @@ public abstract class ActionsSerializer {
         }
         outBuffer.writeShort(length);
         MatchSerializer.encodeMatchEntries(oxmField.getMatchEntries(), outBuffer);
-        ByteBufUtils.padBuffer(EncodeConstants.PADDING - paddingRemainder, outBuffer);
+        if (paddingRemainder != 0) {
+            ByteBufUtils.padBuffer(EncodeConstants.PADDING - paddingRemainder, outBuffer);
+        }
     }
     
     private static void encodePushPbbAction(Action action, ByteBuf outBuffer) {