summaryrefslogtreecommitdiffstats
path: root/l3/impl/src/main/java/io/fd/hc2vpp/l3/write/ipv4/Ipv4AddressCustomizer.java
diff options
context:
space:
mode:
authorTibor Král <tibor.kral@pantheon.tech>2019-02-21 09:48:36 +0100
committerTibor Král <tibor.kral@pantheon.tech>2019-03-28 13:46:05 +0100
commitc6f69e668dcbbe603e803f7671073af302c05c9a (patch)
tree9ae6efa952c1e04ea7c4de75afe10fe289f14f71 /l3/impl/src/main/java/io/fd/hc2vpp/l3/write/ipv4/Ipv4AddressCustomizer.java
parenta2ba7b3fe8d0cdaa0faead940a064081bcb03975 (diff)
HC2VPP-384: Validation support for L3 module
Change-Id: I9f4a856dc70a7ac2a3f8e103143ad15f05402f24 Signed-off-by: Tibor Král <tibor.kral@pantheon.tech>
Diffstat (limited to 'l3/impl/src/main/java/io/fd/hc2vpp/l3/write/ipv4/Ipv4AddressCustomizer.java')
-rw-r--r--l3/impl/src/main/java/io/fd/hc2vpp/l3/write/ipv4/Ipv4AddressCustomizer.java11
1 files changed, 2 insertions, 9 deletions
diff --git a/l3/impl/src/main/java/io/fd/hc2vpp/l3/write/ipv4/Ipv4AddressCustomizer.java b/l3/impl/src/main/java/io/fd/hc2vpp/l3/write/ipv4/Ipv4AddressCustomizer.java
index c3d5871e2..bb664c8ff 100644
--- a/l3/impl/src/main/java/io/fd/hc2vpp/l3/write/ipv4/Ipv4AddressCustomizer.java
+++ b/l3/impl/src/main/java/io/fd/hc2vpp/l3/write/ipv4/Ipv4AddressCustomizer.java
@@ -16,8 +16,6 @@
package io.fd.hc2vpp.l3.write.ipv4;
-import static com.google.common.base.Preconditions.checkNotNull;
-
import io.fd.hc2vpp.common.translate.util.FutureJVppCustomizer;
import io.fd.hc2vpp.common.translate.util.NamingContext;
import io.fd.hc2vpp.l3.utils.ip.write.IpWriter;
@@ -49,7 +47,7 @@ public class Ipv4AddressCustomizer extends FutureJVppCustomizer
public Ipv4AddressCustomizer(@Nonnull final FutureJVppCore futureJVppCore,
@Nonnull final NamingContext interfaceContext) {
super(futureJVppCore);
- this.interfaceContext = checkNotNull(interfaceContext, "Interface context cannot be null");
+ this.interfaceContext = interfaceContext;
}
@Override
@@ -79,11 +77,8 @@ public class Ipv4AddressCustomizer extends FutureJVppCustomizer
if (subnet instanceof PrefixLength) {
setPrefixLengthSubnet(add, id, interfaceName, interfaceIndex, address, (PrefixLength) subnet);
- } else if (subnet instanceof Netmask) {
- setNetmaskSubnet(add, id, interfaceName, interfaceIndex, address, (Netmask) subnet);
} else {
- LOG.error("Unable to handle subnet of type {}", subnet);
- throw new WriteFailedException(id, "Unable to handle subnet of type " + subnet.getClass());
+ setNetmaskSubnet(add, id, interfaceName, interfaceIndex, address, (Netmask) subnet);
}
}
@@ -96,8 +91,6 @@ public class Ipv4AddressCustomizer extends FutureJVppCustomizer
interfaceName, interfaceIndex, subnet, address);
final DottedQuad netmask = subnet.getNetmask();
- checkNotNull(netmask, "netmask value should not be null");
-
final byte subnetLength = getSubnetMaskLength(netmask.getValue());
addDelAddress(getFutureJVpp(), add, id, interfaceIndex, address.getIp(), subnetLength);
}