ONOS-991: The event listener in OpenFlowRuleProvider needs to check the event type because GROUP_STATS are also published now.
Change-Id: I3b61fcc4b59f1b47b11debdb1863d87d36db7744
diff --git a/providers/openflow/flow/src/main/java/org/onosproject/provider/of/flow/impl/OpenFlowRuleProvider.java b/providers/openflow/flow/src/main/java/org/onosproject/provider/of/flow/impl/OpenFlowRuleProvider.java
index f80ab06..dd0bcaa 100644
--- a/providers/openflow/flow/src/main/java/org/onosproject/provider/of/flow/impl/OpenFlowRuleProvider.java
+++ b/providers/openflow/flow/src/main/java/org/onosproject/provider/of/flow/impl/OpenFlowRuleProvider.java
@@ -71,6 +71,7 @@
import org.projectfloodlight.openflow.protocol.OFMessage;
import org.projectfloodlight.openflow.protocol.OFPortStatus;
import org.projectfloodlight.openflow.protocol.OFStatsReply;
+import org.projectfloodlight.openflow.protocol.OFStatsType;
import org.projectfloodlight.openflow.protocol.OFVersion;
import org.projectfloodlight.openflow.protocol.action.OFAction;
import org.projectfloodlight.openflow.protocol.action.OFActionOutput;
@@ -328,7 +329,9 @@
providerService.flowRemoved(fr);
break;
case STATS_REPLY:
- pushFlowMetrics(dpid, (OFStatsReply) msg);
+ if (((OFStatsReply) msg).getStatsType() != OFStatsType.FLOW) {
+ pushFlowMetrics(dpid, (OFFlowStatsReply) msg);
+ }
break;
case BARRIER_REPLY:
future = pendingFutures.get(msg.getXid());
@@ -359,10 +362,9 @@
// Do nothing here for now.
}
- private void pushFlowMetrics(Dpid dpid, OFStatsReply stats) {
+ private void pushFlowMetrics(Dpid dpid, OFFlowStatsReply replies) {
DeviceId did = DeviceId.deviceId(Dpid.uri(dpid));
- final OFFlowStatsReply replies = (OFFlowStatsReply) stats;
List<FlowEntry> flowEntries = replies.getEntries().stream()
.filter(entry -> !tableMissRule(dpid, entry))