Updated the Flow Mod builders (FlowModBuilder, FlowModBuilderVer10,
and FlowModBuilderVer13) to use Ip4Address and Ip4Prefix
instead of the generic IpAddress and IpPrefix when handling
IPv4 source and destination.
Change-Id: If35d735efe4cf557c79dc04eccf38f6a909e4506
diff --git a/providers/openflow/flow/src/main/java/org/onlab/onos/provider/of/flow/impl/FlowModBuilderVer13.java b/providers/openflow/flow/src/main/java/org/onlab/onos/provider/of/flow/impl/FlowModBuilderVer13.java
index 9aff8b7..88dfd1c 100644
--- a/providers/openflow/flow/src/main/java/org/onlab/onos/provider/of/flow/impl/FlowModBuilderVer13.java
+++ b/providers/openflow/flow/src/main/java/org/onlab/onos/provider/of/flow/impl/FlowModBuilderVer13.java
@@ -31,6 +31,7 @@
import org.onlab.onos.net.flow.instructions.L2ModificationInstruction.ModVlanPcpInstruction;
import org.onlab.onos.net.flow.instructions.L3ModificationInstruction;
import org.onlab.onos.net.flow.instructions.L3ModificationInstruction.ModIPInstruction;
+import org.onlab.packet.Ip4Address;
import org.projectfloodlight.openflow.protocol.OFFactory;
import org.projectfloodlight.openflow.protocol.OFFlowAdd;
import org.projectfloodlight.openflow.protocol.OFFlowDelete;
@@ -230,14 +231,17 @@
private OFAction buildL3Modification(Instruction i) {
L3ModificationInstruction l3m = (L3ModificationInstruction) i;
ModIPInstruction ip;
+ Ip4Address ip4;
OFOxm<?> oxm = null;
switch (l3m.subtype()) {
case IP_DST:
ip = (ModIPInstruction) i;
- oxm = factory().oxms().ipv4Dst(IPv4Address.of(ip.ip().toInt()));
+ ip4 = ip.ip().getIp4Address();
+ oxm = factory().oxms().ipv4Dst(IPv4Address.of(ip4.toInt()));
case IP_SRC:
ip = (ModIPInstruction) i;
- oxm = factory().oxms().ipv4Src(IPv4Address.of(ip.ip().toInt()));
+ ip4 = ip.ip().getIp4Address();
+ oxm = factory().oxms().ipv4Src(IPv4Address.of(ip4.toInt()));
default:
log.warn("Unimplemented action type {}.", l3m.subtype());
break;