Committed by
Gerrit Code Review
Bug fix for Dell driver to use dummy group as flow-actions
Change-Id: I2ca81217ad8a51fe0f8f907a1befaa0fd947e40f
Showing
2 changed files
with
27 additions
and
9 deletions
| ... | @@ -1116,11 +1116,18 @@ public class SpringOpenTTP extends AbstractHandlerBehaviour | ... | @@ -1116,11 +1116,18 @@ public class SpringOpenTTP extends AbstractHandlerBehaviour |
| 1116 | } | 1116 | } |
| 1117 | } | 1117 | } |
| 1118 | 1118 | ||
| 1119 | - @SuppressWarnings("unused") | ||
| 1120 | public GroupKey key() { | 1119 | public GroupKey key() { |
| 1121 | return key; | 1120 | return key; |
| 1122 | } | 1121 | } |
| 1123 | 1122 | ||
| 1123 | + public boolean dummy() { | ||
| 1124 | + return dummy; | ||
| 1125 | + } | ||
| 1126 | + | ||
| 1127 | + public TrafficTreatment treatment() { | ||
| 1128 | + return treatment; | ||
| 1129 | + } | ||
| 1130 | + | ||
| 1124 | @Override | 1131 | @Override |
| 1125 | public byte[] data() { | 1132 | public byte[] data() { |
| 1126 | return appKryo.serialize(this); | 1133 | return appKryo.serialize(this); | ... | ... |
| ... | @@ -137,15 +137,26 @@ public class SpringOpenTTPDell extends SpringOpenTTP { | ... | @@ -137,15 +137,26 @@ public class SpringOpenTTPDell extends SpringOpenTTP { |
| 137 | 137 | ||
| 138 | if (next != null) { | 138 | if (next != null) { |
| 139 | SpringOpenGroup soGroup = appKryo.deserialize(next.data()); | 139 | SpringOpenGroup soGroup = appKryo.deserialize(next.data()); |
| 140 | - Group group = groupService.getGroup(deviceId, soGroup.key()); | 140 | + if (soGroup.dummy()) { |
| 141 | - | 141 | + log.debug("Adding {} flow-actions for fwd. obj. {} -> next:{} " |
| 142 | - if (group == null) { | 142 | + + "in dev: {}", soGroup.treatment().allInstructions().size(), |
| 143 | - log.warn("The group left!"); | 143 | + fwd.id(), fwd.nextId(), deviceId); |
| 144 | - fail(fwd, ObjectiveError.GROUPMISSING); | 144 | + for (Instruction ins : soGroup.treatment().allInstructions()) { |
| 145 | - return Collections.emptySet(); | 145 | + treatmentBuilder.add(ins); |
| 146 | + } | ||
| 147 | + } else { | ||
| 148 | + Group group = groupService.getGroup(deviceId, soGroup.key()); | ||
| 149 | + | ||
| 150 | + if (group == null) { | ||
| 151 | + log.warn("The group left!"); | ||
| 152 | + fail(fwd, ObjectiveError.GROUPMISSING); | ||
| 153 | + return Collections.emptySet(); | ||
| 154 | + } | ||
| 155 | + treatmentBuilder.group(group.id()); | ||
| 156 | + log.debug("Adding OUTGROUP action to group:{} for fwd. obj. {} " | ||
| 157 | + + "for next:{} in dev: {}", group.id(), fwd.id(), | ||
| 158 | + fwd.nextId(), deviceId); | ||
| 146 | } | 159 | } |
| 147 | - treatmentBuilder.group(group.id()); | ||
| 148 | - log.debug("Adding OUTGROUP action"); | ||
| 149 | } else { | 160 | } else { |
| 150 | log.warn("processSpecific: No associated next objective object"); | 161 | log.warn("processSpecific: No associated next objective object"); |
| 151 | fail(fwd, ObjectiveError.GROUPMISSING); | 162 | fail(fwd, ObjectiveError.GROUPMISSING); | ... | ... |
-
Please register or login to post a comment