&& !adj.isPhysNetworkFunc()) {
delAdjFromVpnInterface(vpnInterfaceOpIdentifier, adj, dpnId,
operTx, confTx);
- Optional<VpnInterfaceOpDataEntry> optVpnInterface = operTx.read(
- LogicalDatastoreType.OPERATIONAL, vpnInterfaceOpIdentifier).get();
- if (optVpnInterface.isPresent()) {
- VpnInterfaceOpDataEntry vpnInterfaceOpDataEntry = optVpnInterface.get();
- long vpnId = vpnUtil.getVpnId(newVpnName);
- vpnUtil.removePrefixToInterfaceAdj(adj, vpnId,
- vpnInterfaceOpDataEntry, operTx);
- } else {
- LOG.info("update: Vpninterface {} not present in Operational",
- vpnInterfaceName);
- }
//remove FIB entry
String vpnRd = vpnUtil.getVpnRd(newVpnName);
LOG.debug("update: remove prefix {} from the FIB and BGP entry "
return false;
}
- void removePrefixToInterfaceAdj(Adjacency adj, long vpnId, VpnInterfaceOpDataEntry vpnInterfaceOpDataEntry,
- WriteTransaction writeOperTxn) {
- if (writeOperTxn == null) {
- ListenableFutures.addErrorLogging(
- txRunner.callWithNewWriteOnlyTransactionAndSubmit(tx ->
- removePrefixToInterfaceAdj(adj, vpnId, vpnInterfaceOpDataEntry, tx)), LOG,
- "Error removing prefix");
- return;
- }
-
- Optional<Prefixes> prefix = read(LogicalDatastoreType.OPERATIONAL,
- VpnUtil.getPrefixToInterfaceIdentifier(vpnId, VpnUtil.getIpPrefix(adj.getIpAddress())));
- List<Prefixes> prefixToInterface = new ArrayList<>();
- List<Prefixes> prefixToInterfaceLocal = new ArrayList<>();
- if (prefix.isPresent()) {
- prefixToInterfaceLocal.add(prefix.get());
- }
- if (prefixToInterfaceLocal.isEmpty()) {
- for (String nh : adj.getNextHopIpList()) {
- prefix = read(LogicalDatastoreType.OPERATIONAL, VpnUtil.getPrefixToInterfaceIdentifier(vpnId,
- VpnUtil.getIpPrefix(nh)));
- if (prefix.isPresent()) {
- prefixToInterfaceLocal.add(prefix.get());
- }
- }
- }
- if (!prefixToInterfaceLocal.isEmpty()) {
- prefixToInterface.addAll(prefixToInterfaceLocal);
- }
- for (Prefixes pref : prefixToInterface) {
- if (VpnUtil.isMatchedPrefixToInterface(pref, vpnInterfaceOpDataEntry)) {
- writeOperTxn.delete(LogicalDatastoreType.OPERATIONAL,
- VpnUtil.getPrefixToInterfaceIdentifier(vpnId, pref.getIpAddress()));
- }
- }
- }
-
public static void sendNeighborSolicationToOfGroup(Ipv6NdUtilService ipv6NdUtilService, Ipv6Address srcIpv6Address,
MacAddress srcMac, Ipv6Address dstIpv6Address, Long ofGroupId, BigInteger dpId) {
SendNeighborSolicitationToOfGroupInput input = new SendNeighborSolicitationToOfGroupInputBuilder()