summaryrefslogtreecommitdiffstats
path: root/nat/nat2vpp/src/main
diff options
context:
space:
mode:
authorMarek Gradzki <mgradzki@cisco.com>2018-05-11 09:07:04 +0200
committerMarek Gradzki <mgradzki@cisco.com>2018-05-11 09:08:01 +0200
commit6e6b56482dddb1575820b62ae4a39b6006293e9a (patch)
treecbead00692a0ed9488b891d918011e7bddc384ef /nat/nat2vpp/src/main
parent1e1547b7c39f8081ac3621264d0e27d88ba3ffc8 (diff)
NAT: fix port read
Change-Id: I2aceb52f9c3bace7107f203ed717fe7d1c649328 Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
Diffstat (limited to 'nat/nat2vpp/src/main')
-rw-r--r--nat/nat2vpp/src/main/java/io/fd/hc2vpp/nat/read/MappingEntryCustomizer.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/nat/nat2vpp/src/main/java/io/fd/hc2vpp/nat/read/MappingEntryCustomizer.java b/nat/nat2vpp/src/main/java/io/fd/hc2vpp/nat/read/MappingEntryCustomizer.java
index a3874482f..9075f4d0c 100644
--- a/nat/nat2vpp/src/main/java/io/fd/hc2vpp/nat/read/MappingEntryCustomizer.java
+++ b/nat/nat2vpp/src/main/java/io/fd/hc2vpp/nat/read/MappingEntryCustomizer.java
@@ -124,12 +124,12 @@ final class MappingEntryCustomizer implements Ipv4Translator, Ipv6Translator,
if (detail.addrOnly == 0) {
builder.setExternalSrcPort(new ExternalSrcPortBuilder()
.setPortType(new SinglePortNumberBuilder().setSinglePortNumber(new PortNumber(
- (int) detail.externalPort))
+ Short.toUnsignedInt(detail.externalPort)))
.build())
.build());
builder.setInternalSrcPort(new InternalSrcPortBuilder()
.setPortType(new SinglePortNumberBuilder().setSinglePortNumber(new PortNumber(
- (int) detail.localPort))
+ Short.toUnsignedInt(detail.localPort)))
.build())
.build());
}
@@ -151,12 +151,12 @@ final class MappingEntryCustomizer implements Ipv4Translator, Ipv6Translator,
builder.setExternalSrcPort(new ExternalSrcPortBuilder()
.setPortType(new SinglePortNumberBuilder().setSinglePortNumber(new PortNumber(
- (int) detail.oPort))
+ Short.toUnsignedInt(detail.oPort)))
.build())
.build());
builder.setInternalSrcPort(new InternalSrcPortBuilder()
.setPortType(new SinglePortNumberBuilder().setSinglePortNumber(new PortNumber(
- (int) detail.iPort))
+ Short.toUnsignedInt(detail.iPort)))
.build())
.build());
}