Committed by
Gerrit Code Review
Fix for ONOS-2567. Restricting the max out port to 65279
Change-Id: Ic5184d8a389ab5eb4fbe83300764fc39773995cf
Showing
1 changed file
with
3 additions
and
1 deletions
| ... | @@ -53,6 +53,8 @@ import com.google.common.collect.Lists; | ... | @@ -53,6 +53,8 @@ import com.google.common.collect.Lists; |
| 53 | description = "Installs a number of test flow rules - for testing only") | 53 | description = "Installs a number of test flow rules - for testing only") |
| 54 | public class AddTestFlowsCommand extends AbstractShellCommand { | 54 | public class AddTestFlowsCommand extends AbstractShellCommand { |
| 55 | 55 | ||
| 56 | + private static final int MAX_OUT_PORT = 65279; | ||
| 57 | + | ||
| 56 | private CountDownLatch latch; | 58 | private CountDownLatch latch; |
| 57 | 59 | ||
| 58 | @Argument(index = 0, name = "flowPerDevice", description = "Number of flows to add per device", | 60 | @Argument(index = 0, name = "flowPerDevice", description = "Number of flows to add per device", |
| ... | @@ -78,7 +80,7 @@ public class AddTestFlowsCommand extends AbstractShellCommand { | ... | @@ -78,7 +80,7 @@ public class AddTestFlowsCommand extends AbstractShellCommand { |
| 78 | ArrayList<Long> results = Lists.newArrayList(); | 80 | ArrayList<Long> results = Lists.newArrayList(); |
| 79 | Iterable<Device> devices = deviceService.getDevices(); | 81 | Iterable<Device> devices = deviceService.getDevices(); |
| 80 | TrafficTreatment treatment = DefaultTrafficTreatment.builder() | 82 | TrafficTreatment treatment = DefaultTrafficTreatment.builder() |
| 81 | - .setOutput(PortNumber.portNumber(RandomUtils.nextInt())).build(); | 83 | + .setOutput(PortNumber.portNumber(RandomUtils.nextInt(MAX_OUT_PORT))).build(); |
| 82 | TrafficSelector.Builder sbuilder; | 84 | TrafficSelector.Builder sbuilder; |
| 83 | FlowRuleOperations.Builder rules = FlowRuleOperations.builder(); | 85 | FlowRuleOperations.Builder rules = FlowRuleOperations.builder(); |
| 84 | FlowRuleOperations.Builder remove = FlowRuleOperations.builder(); | 86 | FlowRuleOperations.Builder remove = FlowRuleOperations.builder(); | ... | ... |
-
Please register or login to post a comment