Use setInstructions to add apply-actions.
We can't use both setInstructions and setActions, because the actions get overwritten by the call to setInstructions. Fixes ONOS-1113. Change-Id: Id8bb1afd3da91966ce1345c6a1927f8fde5de3f4
Showing
1 changed file
with
8 additions
and
6 deletions
providers/openflow/flow/src/main/java/org/onosproject/provider/of/flow/impl/FlowModBuilderVer13.java
| ... | @@ -102,8 +102,10 @@ public class FlowModBuilderVer13 extends FlowModBuilder { | ... | @@ -102,8 +102,10 @@ public class FlowModBuilderVer13 extends FlowModBuilder { |
| 102 | // write-actions. I would prefer to change this back in the future | 102 | // write-actions. I would prefer to change this back in the future |
| 103 | // because apply-actions is an optional instruction in OF 1.3. | 103 | // because apply-actions is an optional instruction in OF 1.3. |
| 104 | 104 | ||
| 105 | - //OFInstruction writeActions = | 105 | + OFInstruction applyActions = |
| 106 | - //factory().instructions().writeActions(actions); | 106 | + factory().instructions().applyActions(actions); |
| 107 | + | ||
| 108 | + instructions.add(applyActions); | ||
| 107 | 109 | ||
| 108 | long cookie = flowRule().id().value(); | 110 | long cookie = flowRule().id().value(); |
| 109 | 111 | ||
| ... | @@ -112,7 +114,6 @@ public class FlowModBuilderVer13 extends FlowModBuilder { | ... | @@ -112,7 +114,6 @@ public class FlowModBuilderVer13 extends FlowModBuilder { |
| 112 | .setXid(xid) | 114 | .setXid(xid) |
| 113 | .setCookie(U64.of(cookie)) | 115 | .setCookie(U64.of(cookie)) |
| 114 | .setBufferId(OFBufferId.NO_BUFFER) | 116 | .setBufferId(OFBufferId.NO_BUFFER) |
| 115 | - .setActions(actions) | ||
| 116 | .setInstructions(instructions) | 117 | .setInstructions(instructions) |
| 117 | .setMatch(match) | 118 | .setMatch(match) |
| 118 | .setFlags(Collections.singleton(OFFlowModFlags.SEND_FLOW_REM)) | 119 | .setFlags(Collections.singleton(OFFlowModFlags.SEND_FLOW_REM)) |
| ... | @@ -127,8 +128,10 @@ public class FlowModBuilderVer13 extends FlowModBuilder { | ... | @@ -127,8 +128,10 @@ public class FlowModBuilderVer13 extends FlowModBuilder { |
| 127 | Match match = buildMatch(); | 128 | Match match = buildMatch(); |
| 128 | List<OFAction> actions = buildActions(); | 129 | List<OFAction> actions = buildActions(); |
| 129 | List<OFInstruction> instructions = buildInstructions(); | 130 | List<OFInstruction> instructions = buildInstructions(); |
| 130 | - //OFInstruction writeActions = | 131 | + OFInstruction applyActions = |
| 131 | - //factory().instructions().writeActions(actions); | 132 | + factory().instructions().applyActions(actions); |
| 133 | + | ||
| 134 | + instructions.add(applyActions); | ||
| 132 | 135 | ||
| 133 | long cookie = flowRule().id().value(); | 136 | long cookie = flowRule().id().value(); |
| 134 | 137 | ||
| ... | @@ -137,7 +140,6 @@ public class FlowModBuilderVer13 extends FlowModBuilder { | ... | @@ -137,7 +140,6 @@ public class FlowModBuilderVer13 extends FlowModBuilder { |
| 137 | .setXid(xid) | 140 | .setXid(xid) |
| 138 | .setCookie(U64.of(cookie)) | 141 | .setCookie(U64.of(cookie)) |
| 139 | .setBufferId(OFBufferId.NO_BUFFER) | 142 | .setBufferId(OFBufferId.NO_BUFFER) |
| 140 | - .setActions(actions) | ||
| 141 | .setInstructions(instructions) | 143 | .setInstructions(instructions) |
| 142 | .setMatch(match) | 144 | .setMatch(match) |
| 143 | .setFlags(Collections.singleton(OFFlowModFlags.SEND_FLOW_REM)) | 145 | .setFlags(Collections.singleton(OFFlowModFlags.SEND_FLOW_REM)) | ... | ... |
-
Please register or login to post a comment