protected void updateVpnInterface(Uuid vpnId, @Nullable Uuid oldVpnId, Port port, boolean isBeingAssociated,
boolean isSubnetIp,
- TypedWriteTransaction<Configuration> writeConfigTxn) {
+ TypedWriteTransaction<Configuration> writeConfigTxn,
+ boolean isInternetVpn) {
if (vpnId == null || port == null) {
return;
}
neutronvpnUtils.removeVpnPortFixedIpToPort(oldVpnId.getValue(),
ipValue, writeConfigTxn);
}
+ if ((NeutronvpnUtils.getIpVersionFromString(ipValue) != IpVersionChoice.IPV6)
+ && (isInternetVpn == true)) {
+ continue;
+ }
+
neutronvpnUtils.createVpnPortFixedIpToPort(vpnId.getValue(), ipValue, infName, port
.getMacAddress().getValue(), isSubnetIp, writeConfigTxn);
}
txRunner.callWithNewWriteOnlyTransactionAndSubmit(CONFIGURATION, wrtConfigTxn -> {
if (isBeingAssociated) {
updateVpnInterface(vpn, null, neutronvpnUtils.getNeutronPort(
- sm.getRouterInterfacePortId()), true, true, wrtConfigTxn);
+ sm.getRouterInterfacePortId()), true, true, wrtConfigTxn, true);
} else {
removeInternetVpnFromVpnInterface(vpn,
neutronvpnUtils.getNeutronPort(sm.getRouterInterfacePortId()), wrtConfigTxn, sm);
tx -> {
if (isBeingAssociated) {
updateVpnInterface(vpn, null, neutronvpnUtils.getNeutronPort(port),
- true, false, tx);
+ true, false, tx, true);
} else {
removeInternetVpnFromVpnInterface(vpn, neutronvpnUtils.getNeutronPort(port), tx, sm);
}
txRunner.callWithNewWriteOnlyTransactionAndSubmit(CONFIGURATION,
tx -> updateVpnInterface(newVpnId, oldVpnId,
neutronvpnUtils.getNeutronPort(sn.getRouterInterfacePortId()),
- isBeingAssociated, true, tx));
+ isBeingAssociated, true, tx, false));
Futures.addCallback(future, new FutureCallback<Void>() {
@Override
public void onSuccess(Void result) {
txRunner.callWithNewWriteOnlyTransactionAndSubmit(CONFIGURATION,
tx -> updateVpnInterface(newVpnId, oldVpnId,
neutronvpnUtils.getNeutronPort(port), isBeingAssociated, false,
- tx))));
+ tx, false))));
}
}
}