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)
Showing
1 changed file
with
6 additions
and
3 deletions
... | @@ -421,12 +421,15 @@ public class DistributedFlowRuleStore | ... | @@ -421,12 +421,15 @@ 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 | + // always add requested FlowRule | ||
427 | + // Note: 2 equal FlowEntry may have different treatment | ||
428 | + ft.remove(flowEntry); | ||
429 | + ft.add(flowEntry); | ||
426 | toAdd.add(batchEntry); | 430 | toAdd.add(batchEntry); |
427 | } | 431 | } |
428 | } | 432 | } |
429 | - } | ||
430 | if (toAdd.isEmpty() && toRemove.isEmpty()) { | 433 | if (toAdd.isEmpty() && toRemove.isEmpty()) { |
431 | return Futures.immediateFuture(new CompletedBatchOperation(true, Collections.<FlowRule>emptySet())); | 434 | return Futures.immediateFuture(new CompletedBatchOperation(true, Collections.<FlowRule>emptySet())); |
432 | } | 435 | } | ... | ... |
-
Please register or login to post a comment