List<Instruction> instructions = new ArrayList<Instruction>();
instructions.add(MDSALUtil.buildAndGetWriteMetadaInstruction(BigInteger.valueOf(vpnId), MetaDataUtil.METADATA_MASK_VRFID, ++instructionKey));
- instructions.add(MDSALUtil.buildAndGetGotoTableInstruction(VpnConstants.FIB_TABLE, ++instructionKey));
+ instructions.add(MDSALUtil.buildAndGetGotoTableInstruction(NwConstants.L3_FIB_TABLE, ++instructionKey));
BoundServices
serviceInfo =
// Install the flow entry in L3_INTERFACE_TABLE
BigInteger dpId = InterfaceUtils.getDpnForInterface(interfaceManager, vpnInterfaceName);
- String flowRef = VpnUtil.getFlowRef(dpId, VpnConstants.L3_INTERFACE_TABLE,
+ String flowRef = VpnUtil.getFlowRef(dpId, NwConstants.L3_INTERFACE_TABLE,
NwConstants.ETHTYPE_ARP, lPortTag, replyOrRequest.getArpOperation());
FlowEntity flowEntity;
- flowEntity = MDSALUtil.buildFlowEntity(dpId, VpnConstants.L3_INTERFACE_TABLE, flowRef,
+ flowEntity = MDSALUtil.buildFlowEntity(dpId, NwConstants.L3_INTERFACE_TABLE, flowRef,
NwConstants.DEFAULT_ARP_FLOW_PRIORITY, replyOrRequest.getName(), 0, 0,
VpnUtil.getCookieArpFlow(lPortTag), matches, instructions);
InterfaceUtils.getInterfaceStateFromOperDS(broker, interfaceName);
if (existingVpnInterface.isPresent() && interfaceState != null) {
- processVpnInterfaceDown(interfaceName, interfaceState.getIfIndex());
+ processVpnInterfaceDown(interfaceName, interfaceState.getIfIndex(), false);
} else {
LOG.warn("VPN interface {} was unavailable in operational data store to handle remove event", interfaceName);
}
}
- protected synchronized void processVpnInterfaceDown(String interfaceName, int lPortTag) {
+ protected synchronized void processVpnInterfaceDown(String interfaceName, int lPortTag, boolean isInterfaceStateDown) {
VpnInterface vpnInterface = VpnUtil.getOperationalVpnInterface(broker, interfaceName);
if(vpnInterface == null) {
LOG.info("Unable to process delete/down for interface {} as it is not available in operational data store", interfaceName);
removeAdjacenciesFromVpn(identifier, vpnInterface);
LOG.info("Unbinding vpn service from interface {} ", interfaceName);
- unbindService(vpnName, interfaceName, lPortTag);
+ unbindService(vpnName, interfaceName, lPortTag, isInterfaceStateDown);
updateDpnDbs(vpnName, interfaceName, false);
VpnUtil.delete(broker, LogicalDatastoreType.OPERATIONAL, identifier, VpnUtil.DEFAULT_CALLBACK);
}
}
- private void unbindService(String vpnInstanceName, String vpnInterfaceName, int lPortTag) {
- VpnUtil.delete(broker, LogicalDatastoreType.CONFIGURATION,
- InterfaceUtils.buildServiceId(vpnInterfaceName,VpnConstants.L3VPN_SERVICE_IDENTIFIER),
- VpnUtil.DEFAULT_CALLBACK);
+ private void unbindService(String vpnInstanceName, String vpnInterfaceName, int lPortTag, boolean isInterfaceStateDown) {
+ if (!isInterfaceStateDown) {
+ VpnUtil.delete(broker, LogicalDatastoreType.CONFIGURATION,
+ InterfaceUtils.buildServiceId(vpnInterfaceName,
+ VpnConstants.L3VPN_SERVICE_IDENTIFIER),
+ VpnUtil.DEFAULT_CALLBACK);
+ }
long vpnId = VpnUtil.getVpnId(broker, vpnInstanceName);
makeArpFlow(VpnConstants.L3VPN_SERVICE_IDENTIFIER, lPortTag, vpnInterfaceName,
vpnId, ArpReplyOrRequest.REQUEST, NwConstants.DEL_FLOW);