fix for erroneous unsupported messages for devices with extensions.
Change-Id: I63264cd360f260daa4b8a394c9339f1f8c7a1267
diff --git a/providers/openflow/flow/src/main/java/org/onosproject/provider/of/flow/util/FlowEntryBuilder.java b/providers/openflow/flow/src/main/java/org/onosproject/provider/of/flow/util/FlowEntryBuilder.java
index db8a479..16ad6d8 100644
--- a/providers/openflow/flow/src/main/java/org/onosproject/provider/of/flow/util/FlowEntryBuilder.java
+++ b/providers/openflow/flow/src/main/java/org/onosproject/provider/of/flow/util/FlowEntryBuilder.java
@@ -94,16 +94,10 @@
import java.util.List;
-import static org.onosproject.net.flow.criteria.Criteria.matchLambda;
-import static org.onosproject.net.flow.criteria.Criteria.matchOchSignalType;
-import static org.onosproject.net.flow.criteria.Criteria.matchOduSignalId;
-import static org.onosproject.net.flow.criteria.Criteria.matchOduSignalType;
+import static org.onosproject.net.flow.criteria.Criteria.*;
import static org.onosproject.net.flow.instructions.Instructions.modL0Lambda;
import static org.onosproject.net.flow.instructions.Instructions.modL1OduSignalId;
-import static org.onosproject.provider.of.flow.util.OpenFlowValueMapper.lookupChannelSpacing;
-import static org.onosproject.provider.of.flow.util.OpenFlowValueMapper.lookupGridType;
-import static org.onosproject.provider.of.flow.util.OpenFlowValueMapper.lookupOchSignalType;
-import static org.onosproject.provider.of.flow.util.OpenFlowValueMapper.lookupOduSignalType;
+import static org.onosproject.provider.of.flow.util.OpenFlowValueMapper.*;
public class FlowEntryBuilder {
private static final Logger log = LoggerFactory.getLogger(FlowEntryBuilder.class);
@@ -447,17 +441,15 @@
builder.setVlanPcp(vlanpcp.getValue().getValue());
break;
case VLAN_VID:
- if (treatmentInterpreter != null) {
- try {
- builder.extension(treatmentInterpreter.mapAction(action), deviceId);
- } catch (UnsupportedOperationException e) {
- log.warn(e.getMessage());
- }
- } else {
- @SuppressWarnings("unchecked")
- OFOxm<OFVlanVidMatch> vlanvid = (OFOxm<OFVlanVidMatch>) oxm;
- builder.setVlanId(VlanId.vlanId(vlanvid.getValue().getVlan()));
+ try {
+ builder.extension(treatmentInterpreter.mapAction(action), deviceId);
+ break;
+ } catch (UnsupportedOperationException e) {
+ log.debug("Unsupported action extension; defaulting to native OF");
}
+ @SuppressWarnings("unchecked")
+ OFOxm<OFVlanVidMatch> vlanvid = (OFOxm<OFVlanVidMatch>) oxm;
+ builder.setVlanId(VlanId.vlanId(vlanvid.getValue().getVlan()));
break;
case ETH_DST:
@SuppressWarnings("unchecked")
@@ -521,7 +513,7 @@
try {
builder.extension(treatmentInterpreter.mapAction(action), deviceId);
} catch (UnsupportedOperationException e) {
- log.warn(e.getMessage());
+ log.debug(e.getMessage());
}
}
break;