import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.InterfacesState;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.Interface;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.Interface.OperStatus;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.learnt.vpn.vip.to.port.data.LearntVpnVipToPort;
import org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.vpn._interface.op.data.VpnInterfaceOpDataEntry;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.neutronvpn.l3vpn.rev200204.Adjacencies;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.neutronvpn.l3vpn.rev200204.adjacency.list.Adjacency;
import org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.neutronvpn.l3vpn.rev200204.vpn.interfaces.VpnInterface;
import org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.neutronvpn.l3vpn.rev200204.vpn.interfaces.vpn._interface.VpnInstanceNames;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+ " triggered by northbound agent. ignoring.", ifName, vpnName);
continue;
}
+ handleMipAdjRemoval(cfgVpnInterface, vpnName);
final VpnInterfaceOpDataEntry vpnInterface = optVpnInterface.get();
String gwMac = intrf.getPhysAddress() != null ? intrf.getPhysAddress()
.getValue() : vpnInterface.getGatewayMacAddress();
if (optVpnInterface.isPresent()) {
VpnInterfaceOpDataEntry vpnOpInterface =
optVpnInterface.get();
+ handleMipAdjRemoval(vpnIf, vpnName);
vpnInterfaceManager.processVpnInterfaceDown(dpnId,
vpnIf.getName(), ifIndex, update.getPhysAddress()
.getValue(), vpnOpInterface, true,
}
}
+ private void handleMipAdjRemoval(VpnInterface cfgVpnInterface, String vpnName) {
+ String interfaceName = cfgVpnInterface.getName();
+ Adjacencies adjacencies = cfgVpnInterface.augmentation(Adjacencies.class);
+ if (adjacencies != null) {
+ List<Adjacency> adjacencyList = adjacencies.getAdjacency();
+ if (!adjacencyList.isEmpty()) {
+ for (Adjacency adj : adjacencyList) {
+ if (adj.getAdjacencyType() != Adjacency.AdjacencyType.PrimaryAdjacency) {
+ String ipAddress = adj.getIpAddress();
+ String prefix = ipAddress.split("/")[0];
+ LearntVpnVipToPort vpnVipToPort = vpnUtil.getLearntVpnVipToPort(vpnName, prefix);
+ if (vpnVipToPort != null && vpnVipToPort.getPortName().equals(interfaceName)) {
+ vpnUtil.removeMipAdjacency(vpnName, interfaceName, ipAddress, null);
+ } else {
+ LOG.debug("IP {} could be extra-route or learnt-ip on different interface"
+ + "than oper-vpn-interface {}", ipAddress, interfaceName);
+ }
+ }
+ }
+ }
+ }
+ }
+
private class PostVpnInterfaceThreadWorker implements FutureCallback<Void> {
private final String interfaceName;
private final boolean add;