Bug 9116: Fix negative mapping handling 20/66320/1
authorLorand Jakab <lojakab@cisco.com>
Fri, 8 Dec 2017 10:46:23 +0000 (12:46 +0200)
committerLorand Jakab <lojakab@cisco.com>
Fri, 8 Dec 2017 10:46:58 +0000 (12:46 +0200)
Change-Id: I23022dc9481e52363cbb4768caf17a44894e74ee
Signed-off-by: Lorand Jakab <lojakab@cisco.com>
mappingservice/implementation/src/main/java/org/opendaylight/lispflowmapping/implementation/MappingSystem.java

index 922659bba43b4a8f40b97b541555819fcb72fed9..7811ad6f51d9cef402eb586566f939f72712e641 100644 (file)
@@ -243,23 +243,19 @@ public class MappingSystem implements IMappingSystem {
     private void handleSbNegativeMappings(Eid key) {
         Set<Eid> childPrefixes = getSubtree(MappingOrigin.Southbound, key);
 
-        LOG.trace("handleSbNegativeMappings(): subtree prefix set for EID {} (excluding the EID itself): {}",
+        LOG.trace("handleSbNegativeMappings(): subtree prefix set for EID {}: {}",
                 LispAddressStringifier.getString(key),
                 LispAddressStringifier.getString(childPrefixes));
-        if (childPrefixes == null || childPrefixes.isEmpty()) {
-            // The assumption here is that negative prefixes are well maintained and never overlapping.
-            // If we have children for the EID, no parent lookup should thus be necessary.
-            Eid parentPrefix = smc.getCoveringLessSpecific(key);
-            LOG.trace("handleSbNegativeMappings(): parent prefix for EID {}: {}",
-                    LispAddressStringifier.getString(key),
-                    LispAddressStringifier.getString(parentPrefix));
-            handleSbNegativeMapping(parentPrefix);
-            return;
-        }
 
         for (Eid prefix : childPrefixes) {
             handleSbNegativeMapping(prefix);
         }
+
+        Eid parentPrefix = smc.getCoveringLessSpecific(key);
+        LOG.trace("handleSbNegativeMappings(): parent prefix for EID {}: {}",
+                LispAddressStringifier.getString(key),
+                LispAddressStringifier.getString(parentPrefix));
+        handleSbNegativeMapping(parentPrefix);
     }
 
     private void handleSbNegativeMapping(Eid key) {