summaryrefslogtreecommitdiffstats
path: root/acl/acl-impl/src/main/java/io
diff options
context:
space:
mode:
authorMarek Gradzki <mgradzki@cisco.com>2016-12-21 11:00:09 +0100
committerMarek Gradzki <mgradzki@cisco.com>2016-12-21 11:00:09 +0100
commitd5e1e3a563807561caa0b64c414332d85a31f216 (patch)
tree93d321ad158f4b80c784b3606dbf70bf86109213 /acl/acl-impl/src/main/java/io
parent52fabc2b192be911c6de582ea27d145228187a7e (diff)
Fix interface read when alcs are not configured
Change-Id: Id780d9f503901d551f5a9d5693ca0a28cf596a5c Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
Diffstat (limited to 'acl/acl-impl/src/main/java/io')
-rw-r--r--acl/acl-impl/src/main/java/io/fd/hc2vpp/acl/read/VppAclCustomizer.java14
1 files changed, 12 insertions, 2 deletions
diff --git a/acl/acl-impl/src/main/java/io/fd/hc2vpp/acl/read/VppAclCustomizer.java b/acl/acl-impl/src/main/java/io/fd/hc2vpp/acl/read/VppAclCustomizer.java
index 90f2b2fe2..948b6408a 100644
--- a/acl/acl-impl/src/main/java/io/fd/hc2vpp/acl/read/VppAclCustomizer.java
+++ b/acl/acl-impl/src/main/java/io/fd/hc2vpp/acl/read/VppAclCustomizer.java
@@ -102,7 +102,13 @@ public class VppAclCustomizer extends FutureJVppAclCustomizer
dump.aclInterfaceListDetails = dump.aclInterfaceListDetails
.stream()
.map(iface -> {
- iface.acls = Arrays.copyOfRange(iface.acls, 0, iface.nInput - 1);
+ if (iface.acls != null && iface.acls.length > 0) {
+ if (iface.nInput <= 0) {
+ iface.acls = new int[0];
+ } else {
+ iface.acls = Arrays.copyOfRange(iface.acls, 0, iface.nInput);
+ }
+ }
return iface;
})
.collect(Collectors.toList());
@@ -116,7 +122,11 @@ public class VppAclCustomizer extends FutureJVppAclCustomizer
dump.aclInterfaceListDetails = dump.aclInterfaceListDetails
.stream()
.map(iface -> {
- iface.acls = Arrays.copyOfRange(iface.acls, iface.nInput, iface.acls.length);
+ if (iface.nInput >= iface.acls.length) {
+ iface.acls = new int[0];
+ } else {
+ iface.acls = Arrays.copyOfRange(iface.acls, iface.nInput, iface.acls.length);
+ }
return iface;
})
.collect(Collectors.toList());