Bug 8706: Restore null-check in createLocalFibEntry 27/59127/2
authorStephen Kitt <skitt@redhat.com>
Fri, 16 Jun 2017 12:58:08 +0000 (14:58 +0200)
committerSam Hague <shague@redhat.com>
Sat, 17 Jun 2017 18:24:11 +0000 (18:24 +0000)
checkCreateLocalFibEntry handles null gracefully, but dereferencing
localNextHopInfoLocal in the method call renders that useless.

Note that just following the forEach(), localNextHopInfo is always
null which suggests something got lost in the transformation...

Change-Id: If15cc4a881c2a1468c84a4e0cebb2a940465f33b
Signed-off-by: Stephen Kitt <skitt@redhat.com>
Signed-off-by: Sam Hague <shague@redhat.com>
(cherry picked from commit b53e6bdf8ab17e4f96d49d607c3eae0a7332b73c)

vpnservice/fibmanager/fibmanager-impl/src/main/java/org/opendaylight/netvirt/fibmanager/VrfEntryListener.java

index d4bacddae58580a95318c37afb0a89ea2d5e4e80..358b1307c70e934c332000c738e68df047a63e4e 100755 (executable)
@@ -760,9 +760,13 @@ public class VrfEntryListener extends AsyncDataTreeChangeListenerBase<VrfEntry,
                 }
                 Prefixes localNextHopInfoLocal = FibUtil.getPrefixToInterface(dataBroker,
                         vpnId, ipPrefix);
-                BigInteger dpnId = checkCreateLocalFibEntry(localNextHopInfoLocal, localNextHopInfoLocal.getIpAddress(),
-                        vpnId, rd, vrfEntry, vpnId, extraRoute, vpnExtraRoutes);
-                returnLocalDpnId.add(dpnId);
+                if (localNextHopInfoLocal != null) {
+                    BigInteger dpnId = checkCreateLocalFibEntry(localNextHopInfoLocal,
+                                                                localNextHopInfoLocal.getIpAddress(),
+                                                                vpnId, rd, vrfEntry, vpnId, extraRoute,
+                                                                vpnExtraRoutes);
+                    returnLocalDpnId.add(dpnId);
+                }
             });
             if (localNextHopInfo == null) {
             /* imported routes case */