ECMP routes are not clearing in dualstack network 08/74108/1
authorKarthikeyan Krishnan <karthikeyangceb007@gmail.com>
Tue, 17 Jul 2018 10:26:26 +0000 (15:56 +0530)
committerKarthikeyan Krishnan <karthikeyangceb007@gmail.com>
Tue, 17 Jul 2018 10:35:15 +0000 (16:05 +0530)
Problem Description:
====================
ECMP routes are not cleaned up properly in dual
stack network use cases.
The following neutron command is not working
properly for IPv6 address family in extra route
feature.

neutron router-update R1 --no-routes

Solution:
=========
FIBManager is not properly handled for both IPv4 and
IPv6 address family in case of dual stack network.
It is always added IP prefix length value is /32 instead of
validating whether it is IPv4 or IPv6 prefix. As a result
querying prefix-to-interface data store is returning null
value for valid IPv6 prefix. This is the root cause of the
problem for clearing all IPv6 extra routes.

As part of this fix, have handled properly for both IPv4 and IPv6
address family.

Issue: NETVIRT-1355

Change-Id: Iadb69e0c259d125c20c825edbdc7716495eb077a
Signed-off-by: Karthikeyan Krishnan <karthikeyangceb007@gmail.com>
fibmanager/impl/src/main/java/org/opendaylight/netvirt/fibmanager/FibUtil.java

index 9e79148b937696bb75390f6915c2d87a641ab6ae..9b524f62299e8b0fd72b0201f91ee456760afdbc 100644 (file)
@@ -33,6 +33,7 @@ import org.opendaylight.genius.infra.Datastore;
 import org.opendaylight.genius.infra.TypedWriteTransaction;
 import org.opendaylight.genius.mdsalutil.BucketInfo;
 import org.opendaylight.genius.mdsalutil.MDSALUtil;
+import org.opendaylight.genius.mdsalutil.NWUtil;
 import org.opendaylight.genius.mdsalutil.NwConstants;
 import org.opendaylight.netvirt.elanmanager.api.IElanService;
 import org.opendaylight.netvirt.fibmanager.NexthopManager.AdjacencyResult;
@@ -640,7 +641,7 @@ public class FibUtil {
     public static String getIpPrefix(String prefix) {
         String[] prefixValues = prefix.split(FibConstants.PREFIX_SEPARATOR);
         if (prefixValues.length == 1) {
-            prefix = prefix + NwConstants.IPV4PREFIX;
+            return NWUtil.toIpPrefix(prefix);
         }
         return prefix;
     }