Don't check net type for empty adj list 87/76987/2
authorJosh <jhershbe@redhat.com>
Mon, 15 Oct 2018 09:13:44 +0000 (12:13 +0300)
committerSam Hague <shague@redhat.com>
Tue, 16 Oct 2018 12:53:35 +0000 (12:53 +0000)
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 <jhershbe@redhat.com>
vpnmanager/impl/src/main/java/org/opendaylight/netvirt/vpnmanager/iplearn/AbstractIpLearnNotificationHandler.java

index f8de2ad7577e2e241e81c168589d354c37c8fbf3..bd1c96a8dcb56751b51f8df94fb2963fa7c13898 100644 (file)
@@ -63,7 +63,7 @@ public abstract class AbstractIpLearnNotificationHandler {
         List<Adjacency> 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