Yuta HIGUCHI
Committed by Pavlin Radoslavov

DistributedFlowRuleStore: always add FlowEntry on batchStore

related to ONOS-481

[Merged from master]

Change-Id: I9f82c7d9736dab7326062af9c38ae6e290a9b818
(cherry picked from commit 08f156b4)
...@@ -421,10 +421,13 @@ public class DistributedFlowRuleStore ...@@ -421,10 +421,13 @@ public class DistributedFlowRuleStore
421 } else if (op.equals(FlowRuleOperation.ADD)) { 421 } else if (op.equals(FlowRuleOperation.ADD)) {
422 StoredFlowEntry flowEntry = new DefaultFlowEntry(flowRule); 422 StoredFlowEntry flowEntry = new DefaultFlowEntry(flowRule);
423 DeviceId deviceId = flowRule.deviceId(); 423 DeviceId deviceId = flowRule.deviceId();
424 - if (!flowEntries.containsEntry(deviceId, flowEntry)) { 424 + Collection<StoredFlowEntry> ft = flowEntries.get(deviceId);
425 - flowEntries.put(deviceId, flowEntry); 425 +
426 - toAdd.add(batchEntry); 426 + // always add requested FlowRule
427 - } 427 + // Note: 2 equal FlowEntry may have different treatment
428 + ft.remove(flowEntry);
429 + ft.add(flowEntry);
430 + toAdd.add(batchEntry);
428 } 431 }
429 } 432 }
430 if (toAdd.isEmpty() && toRemove.isEmpty()) { 433 if (toAdd.isEmpty() && toRemove.isEmpty()) {
......