Do not send group stats request if unsupported
Change-Id: I1f0665dd9badfc5d29cea49c3fca48688ca77bc0
diff --git a/providers/openflow/group/src/main/java/org/onosproject/provider/of/group/impl/OpenFlowGroupProvider.java b/providers/openflow/group/src/main/java/org/onosproject/provider/of/group/impl/OpenFlowGroupProvider.java
index b536fda..0f55b41 100644
--- a/providers/openflow/group/src/main/java/org/onosproject/provider/of/group/impl/OpenFlowGroupProvider.java
+++ b/providers/openflow/group/src/main/java/org/onosproject/provider/of/group/impl/OpenFlowGroupProvider.java
@@ -65,6 +65,7 @@
import org.onosproject.openflow.controller.RoleState;
import org.osgi.service.component.ComponentContext;
import org.projectfloodlight.openflow.protocol.OFBucketCounter;
+import org.projectfloodlight.openflow.protocol.OFCapabilities;
import org.projectfloodlight.openflow.protocol.OFErrorMsg;
import org.projectfloodlight.openflow.protocol.OFErrorType;
import org.projectfloodlight.openflow.protocol.OFGroupDescStatsEntry;
@@ -412,7 +413,7 @@
if (sw == null) {
return;
}
- if (isGroupSupported(sw)) {
+ if (isGroupSupported(sw) && sw.features().getCapabilities().contains(OFCapabilities.GROUP_STATS)) {
GroupStatsCollector gsc = new GroupStatsCollector(sw, groupPollInterval);
stopCollectorIfNeeded(collectors.put(dpid, gsc));
gsc.start();