IPv6 CVR North-South Support
[netvirt.git] / natservice / impl / src / main / java / org / opendaylight / netvirt / natservice / internal / ExternalNetworkGroupInstaller.java
index 5e333910274840a28cea9c1cb18b9a8cf53c4030..f2f4521758ce2cfb2eee5dd0532a8cb864e490b5 100644 (file)
@@ -16,6 +16,7 @@ import java.util.Arrays;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.List;
+import javax.annotation.Nullable;
 import javax.inject.Inject;
 import javax.inject.Singleton;
 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
@@ -175,11 +176,9 @@ public class ExternalNetworkGroupInstaller {
     private void installExtNetGroupEntry(long groupId, String subnetName, String extInterface,
             String macAddress, BigInteger dpnId) {
 
-        coordinator.enqueueJob(NatConstants.NAT_DJC_PREFIX + subnetName + extInterface, () -> {
+        coordinator.enqueueJob(NatUtil.getDefaultFibRouteToSNATForSubnetJobKey(subnetName, dpnId), () -> {
             GroupEntity groupEntity = buildExtNetGroupEntity(macAddress, subnetName, groupId, extInterface, dpnId);
-            if (groupEntity != null) {
-                mdsalManager.syncInstallGroup(groupEntity);
-            }
+            mdsalManager.syncInstallGroup(groupEntity);
             return Collections.emptyList();
         });
     }
@@ -248,6 +247,7 @@ public class ExternalNetworkGroupInstaller {
         return MDSALUtil.buildGroupEntity(dpnId, groupId, subnetName, GroupTypes.GroupAll, listBucketInfo);
     }
 
+    @Nullable
     private GroupEntity buildEmptyExtNetGroupEntity(String subnetName, long groupId, String extInterface) {
         BigInteger dpId = NatUtil.getDpnForInterface(odlInterfaceRpcService, extInterface);
         if (BigInteger.ZERO.equals(dpId)) {