From: Prasanna Huddar Date: Mon, 2 Dec 2013 11:33:54 +0000 (+0530) Subject: Group and Port are not mandatory in Flow. X-Git-Tag: jenkins-openflowjava-bulk-release-prepare-only-1~46 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=commitdiff_plain;h=bc16c5466bdbc8b593b9b62853e4162d4aabc32b;p=openflowjava.git Group and Port are not mandatory in Flow. Signed-off-by: Prasanna Huddar Change-Id: Id6e8842a0e78486dfec6b439af716540318349fd --- diff --git a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/FlowModInputMessageFactory.java b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/FlowModInputMessageFactory.java index 4793c286..8889339a 100644 --- a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/FlowModInputMessageFactory.java +++ b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/FlowModInputMessageFactory.java @@ -49,8 +49,13 @@ public class FlowModInputMessageFactory implements OFSerializer { out.writeShort(message.getHardTimeout().intValue()); out.writeShort(message.getPriority()); out.writeInt(message.getBufferId().intValue()); - out.writeInt(message.getOutPort().getValue().intValue()); - out.writeInt(message.getOutGroup().intValue()); + if (message.getOutPort() != null) { + out.writeInt(message.getOutPort().getValue().intValue()); + } + + if (message.getOutGroup() != null) { + out.writeInt(message.getOutGroup().intValue()); + } out.writeShort(createFlowModFlagsBitmask(message.getFlags())); ByteBufUtils.padBuffer(PADDING_IN_FLOW_MOD_MESSAGE, out); MatchSerializer.encodeMatch(message.getMatch(), out); diff --git a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/OF10FlowModInputMessageFactory.java b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/OF10FlowModInputMessageFactory.java index 7821cd49..f0858af0 100644 --- a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/OF10FlowModInputMessageFactory.java +++ b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/OF10FlowModInputMessageFactory.java @@ -48,7 +48,9 @@ public class OF10FlowModInputMessageFactory implements OFSerializer