Fixing a couple of bugs in default entries for corsa pipeline.
Also fixing flowRule table-awareness with changes reflected in flow identification (hashing)
and the karaf CLI.
Change-Id: I2fac83db8e0b54b802fb765ef9d82033f7478b99
diff --git a/providers/openflow/flow/src/main/java/org/onosproject/provider/of/flow/impl/FlowModBuilderVer13.java b/providers/openflow/flow/src/main/java/org/onosproject/provider/of/flow/impl/FlowModBuilderVer13.java
index b1848f2..00bb197 100644
--- a/providers/openflow/flow/src/main/java/org/onosproject/provider/of/flow/impl/FlowModBuilderVer13.java
+++ b/providers/openflow/flow/src/main/java/org/onosproject/provider/of/flow/impl/FlowModBuilderVer13.java
@@ -97,19 +97,20 @@
Match match = buildMatch();
List<OFAction> actions = buildActions();
List<OFInstruction> instructions = buildInstructions();
+
// FIXME had to revert back to using apply-actions instead of
// write-actions because LINC-OE apparently doesn't support
// write-actions. I would prefer to change this back in the future
// because apply-actions is an optional instruction in OF 1.3.
- OFInstruction applyActions =
- factory().instructions().applyActions(actions);
-
- instructions.add(applyActions);
+ if (actions != null) {
+ OFInstruction applyActions =
+ factory().instructions().applyActions(actions);
+ instructions.add(applyActions);
+ }
long cookie = flowRule().id().value();
-
OFFlowAdd fm = factory().buildFlowAdd()
.setXid(xid)
.setCookie(U64.of(cookie))
@@ -129,14 +130,15 @@
Match match = buildMatch();
List<OFAction> actions = buildActions();
List<OFInstruction> instructions = buildInstructions();
- OFInstruction applyActions =
- factory().instructions().applyActions(actions);
- instructions.add(applyActions);
+ if (actions != null) {
+ OFInstruction applyActions =
+ factory().instructions().applyActions(actions);
+ instructions.add(applyActions);
+ }
long cookie = flowRule().id().value();
-
OFFlowMod fm = factory().buildFlowModify()
.setXid(xid)
.setCookie(U64.of(cookie))
@@ -189,6 +191,7 @@
private List<OFAction> buildActions() {
List<OFAction> actions = new LinkedList<>();
+ boolean tableFound = false;
if (treatment == null) {
return actions;
}
@@ -223,12 +226,17 @@
break;
case TABLE:
//FIXME: should not occur here.
+ tableFound = true;
break;
default:
log.warn("Instruction type {} not yet implemented.", i.type());
}
}
-
+ if (tableFound && actions.isEmpty()) {
+ // handles the case where there are no actions, but there is
+ // a goto instruction for the next table
+ return null;
+ }
return actions;
}