Bug 5199 : DHCP and Transparent code changes
[vpnservice.git] / interfacemgr / interfacemgr-impl / src / main / java / org / opendaylight / vpnservice / interfacemgr / rpcservice / InterfaceManagerRpcService.java
index b21cd15b1790164e64f790393378dfa080290efd..daa613aac4ddaa81d10686fa650b5052ba1a9a52 100644 (file)
@@ -357,8 +357,13 @@ public class InterfaceManagerRpcService implements OdlInterfaceRpcService {
         if(L2vlan.class.equals(ifType)){
             IfL2vlan vlanIface = interfaceInfo.getAugmentation(IfL2vlan.class);
             LOG.trace("L2Vlan: {}",vlanIface);
-            long vlanVid = (vlanIface == null) ? 0 : vlanIface.getVlanId().getValue();
-            if (vlanVid != 0) {
+            long vlanVid = 0;
+            boolean isVlanTransparent = false;
+            if (vlanIface != null) {
+                vlanVid = vlanIface.getVlanId() == null ? 0 : vlanIface.getVlanId().getValue();
+                isVlanTransparent = vlanIface.getL2vlanMode() == IfL2vlan.L2vlanMode.Transparent;
+            }
+            if (vlanVid != 0 && !isVlanTransparent) {
                 listActionInfo.add(new ActionInfo(ActionType.push_vlan, new String[] {}));
                 listActionInfo.add(new ActionInfo(ActionType.set_field_vlan_vid,
                         new String[] { Long.toString(vlanVid) }));