Committed by
Yuta Higuchi
DistributedFlowRuleStore: always add FlowEntry on batchStore
related to ONOS-481 Change-Id: I9f82c7d9736dab7326062af9c38ae6e290a9b818
Showing
1 changed file
with
6 additions
and
3 deletions
... | @@ -417,12 +417,15 @@ public class DistributedFlowRuleStore | ... | @@ -417,12 +417,15 @@ public class DistributedFlowRuleStore |
417 | } else if (op.equals(FlowRuleOperation.ADD)) { | 417 | } else if (op.equals(FlowRuleOperation.ADD)) { |
418 | StoredFlowEntry flowEntry = new DefaultFlowEntry(flowRule); | 418 | StoredFlowEntry flowEntry = new DefaultFlowEntry(flowRule); |
419 | DeviceId deviceId = flowRule.deviceId(); | 419 | DeviceId deviceId = flowRule.deviceId(); |
420 | - if (!flowEntries.containsEntry(deviceId, flowEntry)) { | 420 | + Collection<StoredFlowEntry> ft = flowEntries.get(deviceId); |
421 | - flowEntries.put(deviceId, flowEntry); | 421 | + |
422 | + // always add requested FlowRule | ||
423 | + // Note: 2 equal FlowEntry may have different treatment | ||
424 | + ft.remove(flowEntry); | ||
425 | + ft.add(flowEntry); | ||
422 | toAdd.add(batchEntry); | 426 | toAdd.add(batchEntry); |
423 | } | 427 | } |
424 | } | 428 | } |
425 | - } | ||
426 | if (toAdd.isEmpty() && toRemove.isEmpty()) { | 429 | if (toAdd.isEmpty() && toRemove.isEmpty()) { |
427 | return Futures.immediateFuture(new CompletedBatchOperation(true, Collections.<FlowRule>emptySet())); | 430 | return Futures.immediateFuture(new CompletedBatchOperation(true, Collections.<FlowRule>emptySet())); |
428 | } | 431 | } | ... | ... |
-
Please register or login to post a comment