From 6b51cbd98cfc45f90fd4b61ae9ea28c23999288f Mon Sep 17 00:00:00 2001 From: Michal Cmarada Date: Thu, 3 May 2018 09:42:34 +0200 Subject: HC2VPP-314 - fix for IPV6 routes with 128 subnet prefix VPP uses byte in range of 0 to 255 but when jni is used and this type is converted to java byte which has range of -128 to 127 it will convert it to negative value. It then fails to create Ip6Prefix from this value. Change-Id: Ic18686959682c153da2e4ee4a7f7841c9b56e5d3 Signed-off-by: Michal Cmarada --- .../main/java/io/fd/hc2vpp/common/translate/util/Ipv6Translator.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'vpp-common') diff --git a/vpp-common/vpp-translate-utils/src/main/java/io/fd/hc2vpp/common/translate/util/Ipv6Translator.java b/vpp-common/vpp-translate-utils/src/main/java/io/fd/hc2vpp/common/translate/util/Ipv6Translator.java index 6d939af07..dbfe81d6c 100644 --- a/vpp-common/vpp-translate-utils/src/main/java/io/fd/hc2vpp/common/translate/util/Ipv6Translator.java +++ b/vpp-common/vpp-translate-utils/src/main/java/io/fd/hc2vpp/common/translate/util/Ipv6Translator.java @@ -60,7 +60,7 @@ public interface Ipv6Translator extends ByteDataTranslator { default byte extractPrefix(Ipv6Prefix data) { checkNotNull(data, "Cannot extract from null"); - return Byte.valueOf(data.getValue().substring(data.getValue().indexOf('/') + 1)); + return Integer.valueOf(data.getValue().substring(data.getValue().indexOf('/') + 1)).byteValue(); } /** -- cgit 1.2.3-korg