From: Josh Date: Mon, 15 Oct 2018 09:13:44 +0000 (+0300) Subject: Don't check net type for empty adj list X-Git-Tag: release/neon~113 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=commitdiff_plain;h=d13f2e16fc0f0d218477c03eadd36e79ea40b3e8;p=netvirt.git Don't check net type for empty adj list The code previously assumed that if the list was present it would not be empty resulting in the flawed conclusion that the non-existant adjacency is of the wrong IP version ;-) Change-Id: I5ff8c4fc54a637cc02a3fe18e7c522183c869274 Signed-off-by: Josh --- diff --git a/vpnmanager/impl/src/main/java/org/opendaylight/netvirt/vpnmanager/iplearn/AbstractIpLearnNotificationHandler.java b/vpnmanager/impl/src/main/java/org/opendaylight/netvirt/vpnmanager/iplearn/AbstractIpLearnNotificationHandler.java index f8de2ad757..bd1c96a8dc 100644 --- a/vpnmanager/impl/src/main/java/org/opendaylight/netvirt/vpnmanager/iplearn/AbstractIpLearnNotificationHandler.java +++ b/vpnmanager/impl/src/main/java/org/opendaylight/netvirt/vpnmanager/iplearn/AbstractIpLearnNotificationHandler.java @@ -63,7 +63,7 @@ public abstract class AbstractIpLearnNotificationHandler { List adjacencies = vpnUtil.getAdjacenciesForVpnInterfaceFromConfig(srcInterface); IpVersionChoice srcIpVersion = vpnUtil.getIpVersionFromString(srcIP.stringValue()); boolean isSrcIpVersionPartOfVpn = false; - if (adjacencies != null) { + if (adjacencies != null && !adjacencies.isEmpty()) { for (Adjacency adj : adjacencies) { IpPrefix ipPrefix = IpPrefixBuilder.getDefaultInstance(adj.getIpAddress()); // If extra/static route is configured, we should ignore for learning process