commit | 08f156b45e2ff1e225082d47b7c36edfffa75971 | [log] [tgz] |
---|---|---|
author | Yuta HIGUCHI <y-higuchi@ak.jp.nec.com> | Fri Dec 12 13:34:05 2014 -0800 |
committer | Yuta Higuchi <y-higuchi@onlab.us> | Wed Dec 17 17:53:21 2014 +0000 |
tree | 09fa6c84b791cf324102369d5fbd05cc57611f60 | |
parent | 420691ac20698c506024b9a466444d814f07e2a4 [diff] |
DistributedFlowRuleStore: always add FlowEntry on batchStore related to ONOS-481 Change-Id: I9f82c7d9736dab7326062af9c38ae6e290a9b818
diff --git a/core/store/dist/src/main/java/org/onosproject/store/flow/impl/DistributedFlowRuleStore.java b/core/store/dist/src/main/java/org/onosproject/store/flow/impl/DistributedFlowRuleStore.java index 1f9c708..e5b2b82 100644 --- a/core/store/dist/src/main/java/org/onosproject/store/flow/impl/DistributedFlowRuleStore.java +++ b/core/store/dist/src/main/java/org/onosproject/store/flow/impl/DistributedFlowRuleStore.java
@@ -417,10 +417,13 @@ } else if (op.equals(FlowRuleOperation.ADD)) { StoredFlowEntry flowEntry = new DefaultFlowEntry(flowRule); DeviceId deviceId = flowRule.deviceId(); - if (!flowEntries.containsEntry(deviceId, flowEntry)) { - flowEntries.put(deviceId, flowEntry); - toAdd.add(batchEntry); - } + Collection<StoredFlowEntry> ft = flowEntries.get(deviceId); + + // always add requested FlowRule + // Note: 2 equal FlowEntry may have different treatment + ft.remove(flowEntry); + ft.add(flowEntry); + toAdd.add(batchEntry); } } if (toAdd.isEmpty() && toRemove.isEmpty()) {