Bug 5207: Fix missing Map-Notify caused NPE 98/33998/1
authorLorand Jakab <lojakab@cisco.com>
Wed, 3 Feb 2016 15:47:52 +0000 (17:47 +0200)
committerLorand Jakab <lojakab@cisco.com>
Wed, 3 Feb 2016 15:47:52 +0000 (17:47 +0200)
Additionally, change the log level for the missing Map-Notify to DEBUG,
since in case the Want-Map-Notify bit is not set, it is normal not to
have a Map-Notify.

Change-Id: I09262fa5afcb8d769a06af2c94d9ccb180bb867c
Signed-off-by: Lorand Jakab <lojakab@cisco.com>
mappingservice/implementation/src/main/java/org/opendaylight/lispflowmapping/implementation/LispMappingService.java

index e3916bffa42d13f21a380382bfedbd035fd68c52..347d33fd5dac88bed230b82b6e9d07e5db5cbd3c 100644 (file)
@@ -191,9 +191,9 @@ public class LispMappingService implements IFlowMapping, BindingAwareProvider, I
     @Override
     public void onAddMapping(AddMapping mapRegisterNotification) {
         Pair<MapNotify, List<TransportAddress>> result = handleMapRegister(mapRegisterNotification.getMapRegister());
-        MapNotify mapNotify = result.getLeft();
-        List<TransportAddress> rlocs = result.getRight();
-        if (mapNotify != null) {
+        if (result != null && result.getLeft() != null) {
+            MapNotify mapNotify = result.getLeft();
+            List <TransportAddress> rlocs = result.getRight();
             if (rlocs == null) {
                 TransportAddressBuilder tab = new TransportAddressBuilder();
                 tab.setIpAddress(mapRegisterNotification.getTransportAddress().getIpAddress());
@@ -205,7 +205,7 @@ public class LispMappingService implements IFlowMapping, BindingAwareProvider, I
                 }
             }
         } else {
-            LOG.warn("got null map notify");
+            LOG.debug("Not sending Map-Notify");
         }
     }