summaryrefslogtreecommitdiffstats
path: root/routing/routing-impl/src/main/java/io
diff options
context:
space:
mode:
authorMichal Cmarada <michal.cmarada@pantheon.tech>2018-07-09 13:59:31 +0200
committerMichal Cmarada <michal.cmarada@pantheon.tech>2018-07-18 12:25:43 +0200
commit20529403b5f257298670f839ad630fbf0c215a7d (patch)
tree031e6d3f9a7968e7ccd35eaba3ca95a1009450c4 /routing/routing-impl/src/main/java/io
parent220404db4488c6562f50f4b45ba75c8c256c8121 (diff)
Fix binding name for route
In specific case when route uses 128 mask and this value is converted to byte value it is changed to -128, which breaks internal naming of routes. This needed to be fixed because routes with 128 mask are not being read from VPP to operational state. Change-Id: Ic3b6ded721e7996587982b6a2b3bc8c9ebe03b43 Signed-off-by: Michal Cmarada <michal.cmarada@pantheon.tech>
Diffstat (limited to 'routing/routing-impl/src/main/java/io')
-rw-r--r--routing/routing-impl/src/main/java/io/fd/hc2vpp/routing/naming/Ipv6RouteNamesFactory.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/routing/routing-impl/src/main/java/io/fd/hc2vpp/routing/naming/Ipv6RouteNamesFactory.java b/routing/routing-impl/src/main/java/io/fd/hc2vpp/routing/naming/Ipv6RouteNamesFactory.java
index da8affb7b..91370c7fd 100644
--- a/routing/routing-impl/src/main/java/io/fd/hc2vpp/routing/naming/Ipv6RouteNamesFactory.java
+++ b/routing/routing-impl/src/main/java/io/fd/hc2vpp/routing/naming/Ipv6RouteNamesFactory.java
@@ -56,7 +56,7 @@ public final class Ipv6RouteNamesFactory implements RouteMapper, RouteRequestPro
return bindName(parentProtocolName,
// to have address in compressed form
doubleDotlessAddress(route.getDestinationPrefix()),
- String.valueOf(extractPrefix(route.getDestinationPrefix())));
+ route.getDestinationPrefix().getValue().substring(route.getDestinationPrefix().getValue().indexOf('/') + 1));
}
/**
@@ -72,7 +72,8 @@ public final class Ipv6RouteNamesFactory implements RouteMapper, RouteRequestPro
* Construct unique name from provided parentProtocolName and {@code Ipv6Prefix}
*/
public String uniqueRouteName(@Nonnull final String parentProtocolName, @Nonnull final Ipv6Prefix prefix) {
- return bindName(parentProtocolName, doubleDotlessAddress(prefix), String.valueOf(extractPrefix(prefix)));
+ return bindName(parentProtocolName, doubleDotlessAddress(prefix),
+ prefix.getValue().substring(prefix.getValue().indexOf('/') + 1));
}