Unbind Service not removing the ingress flow entry
[vpnservice.git] / interfacemgr / interfacemgr-impl / src / main / java / org / opendaylight / vpnservice / interfacemgr / servicebindings / flowbased / statehelpers / FlowBasedServicesStateBindHelper.java
index 0e067c4ea794782eadf04c856c97dfac5826ff26..916fc11a5cf2de797507878a2b760d2ebb9d7e21 100644 (file)
@@ -68,14 +68,17 @@ public class FlowBasedServicesStateBindHelper {
         int vlanId = 0;
         List<MatchInfo> matches = null;
         if (iface.getType().isAssignableFrom(L2vlan.class)) {
-            vlanId = iface.getAugmentation(IfL2vlan.class).getVlanId().getValue();
+            IfL2vlan l2vlan = iface.getAugmentation(IfL2vlan.class);
+            if(l2vlan != null) {
+                vlanId = l2vlan.getVlanId().getValue();
+            }
             matches = FlowBasedServicesUtils.getMatchInfoForVlanPortAtIngressTable(dpId, portNo, vlanId);
         } else if (iface.getType().isAssignableFrom(Tunnel.class)){
             matches = FlowBasedServicesUtils.getMatchInfoForTunnelPortAtIngressTable (dpId, portNo, iface);
         }
 
         if (matches != null) {
-            FlowBasedServicesUtils.installInterfaceIngressFlow(dpId, vlanId, highestPriorityBoundService,
+            FlowBasedServicesUtils.installInterfaceIngressFlow(dpId, iface.getName(), vlanId, highestPriorityBoundService,
                     dataBroker, t, matches, lportTag.intValue(), IfmConstants.VLAN_INTERFACE_INGRESS_TABLE);
         }