summaryrefslogtreecommitdiffstats
path: root/nat/nat2vpp/src/main
diff options
context:
space:
mode:
authorMichal Cmarada <mcmarada@cisco.com>2019-05-17 10:31:23 +0200
committerMichal Cmarada <mcmarada@cisco.com>2019-05-17 10:31:23 +0200
commit0d5d328b1d0e9de2d1c7ab957139846c2feb8038 (patch)
treef414dd8fa3cfe40d0b1ffbd74dd6172ac4e8c7f8 /nat/nat2vpp/src/main
parent68f67ac93942800eb09efa92f222cb8ac592bacc (diff)
fix flags and Tag in NAT implementation
- tag being null causes crashes when vpp API is called - null flags causes crashes, flags should be set at least to default value (0) Change-Id: If4e116212b1a85b312837830501ec226cec37bfa Signed-off-by: Michal Cmarada <mcmarada@cisco.com>
Diffstat (limited to 'nat/nat2vpp/src/main')
-rw-r--r--nat/nat2vpp/src/main/java/io/fd/hc2vpp/nat/write/ExternalIpPoolCustomizer.java4
-rw-r--r--nat/nat2vpp/src/main/java/io/fd/hc2vpp/nat/write/MappingEntryCustomizer.java1
2 files changed, 5 insertions, 0 deletions
diff --git a/nat/nat2vpp/src/main/java/io/fd/hc2vpp/nat/write/ExternalIpPoolCustomizer.java b/nat/nat2vpp/src/main/java/io/fd/hc2vpp/nat/write/ExternalIpPoolCustomizer.java
index 8b9d9dd41..2df0c7e2d 100644
--- a/nat/nat2vpp/src/main/java/io/fd/hc2vpp/nat/write/ExternalIpPoolCustomizer.java
+++ b/nat/nat2vpp/src/main/java/io/fd/hc2vpp/nat/write/ExternalIpPoolCustomizer.java
@@ -28,6 +28,7 @@ import io.fd.honeycomb.translate.write.WriteFailedException;
import io.fd.jvpp.nat.dto.Nat44AddDelAddressRange;
import io.fd.jvpp.nat.dto.Nat64AddDelPoolAddrRange;
import io.fd.jvpp.nat.future.FutureJVppNatFacade;
+import io.fd.jvpp.nat.types.NatConfigFlags;
import javax.annotation.Nonnull;
import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.vpp.nat.rev180510.ExternalIpAddressPoolAugmentation;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Prefix;
@@ -81,6 +82,9 @@ final class ExternalIpPoolCustomizer implements ListWriterCustomizer<ExternalIpA
getReplyForWrite(jvppNat.nat64AddDelPoolAddrRange(request).toCompletableFuture(), id);
} else {
final Nat44AddDelAddressRange request = getNat44Request(addressPool.getExternalIpPool(), isAdd);
+ if (request.flags == null) {
+ request.flags = new NatConfigFlags();
+ }
getReplyForWrite(jvppNat.nat44AddDelAddressRange(request).toCompletableFuture(), id);
}
}
diff --git a/nat/nat2vpp/src/main/java/io/fd/hc2vpp/nat/write/MappingEntryCustomizer.java b/nat/nat2vpp/src/main/java/io/fd/hc2vpp/nat/write/MappingEntryCustomizer.java
index bf7811852..00bd77483 100644
--- a/nat/nat2vpp/src/main/java/io/fd/hc2vpp/nat/write/MappingEntryCustomizer.java
+++ b/nat/nat2vpp/src/main/java/io/fd/hc2vpp/nat/write/MappingEntryCustomizer.java
@@ -162,6 +162,7 @@ final class MappingEntryCustomizer implements ListWriterCustomizer<MappingEntry,
request.localPort = internalPortNumber.shortValue();
request.externalPort = externalPortNumber.shortValue();
}
+ request.tag = "";
return request;
}