mirror of https://github.com/apache/cloudstack.git
CLOUDSTACK-6747: call a more forgiving test on the supplied peer
cidr-list
(cherry picked from commit 17850c7aff)
Conflicts:
api/src/org/apache/cloudstack/api/command/user/vpn/CreateVpnCustomerGatewayCmd.java
server/src/com/cloud/network/vpn/Site2SiteVpnManagerImpl.java
This commit is contained in:
parent
5673c036c0
commit
8d0f49addd
|
|
@ -46,8 +46,8 @@ public class CreateVpnCustomerGatewayCmd extends BaseAsyncCmd {
|
|||
@Parameter(name=ApiConstants.GATEWAY, type=CommandType.STRING, required=true, description="public ip address id of the customer gateway")
|
||||
private String gatewayIp;
|
||||
|
||||
@Parameter(name=ApiConstants.CIDR_LIST, type=CommandType.STRING, required=true, description="guest cidr list of the customer gateway")
|
||||
private String guestCidrList;
|
||||
@Parameter(name = ApiConstants.CIDR_LIST, type = CommandType.STRING, required = true, description = "guest cidr list of the customer gateway")
|
||||
private String peerCidrList;
|
||||
|
||||
@Parameter(name=ApiConstants.IPSEC_PSK, type=CommandType.STRING, required=true, description="IPsec Preshared-Key of the customer gateway")
|
||||
private String ipsecPsk;
|
||||
|
|
@ -89,7 +89,7 @@ public class CreateVpnCustomerGatewayCmd extends BaseAsyncCmd {
|
|||
}
|
||||
|
||||
public String getGuestCidrList() {
|
||||
return guestCidrList;
|
||||
return peerCidrList;
|
||||
}
|
||||
|
||||
public String getGatewayIp() {
|
||||
|
|
|
|||
|
|
@ -171,9 +171,9 @@ public class Site2SiteVpnManagerImpl extends ManagerBase implements Site2SiteVpn
|
|||
if (name == null) {
|
||||
name = "VPN-" + gatewayIp;
|
||||
}
|
||||
String guestCidrList = cmd.getGuestCidrList();
|
||||
if (!NetUtils.validateGuestCidrList(guestCidrList)) {
|
||||
throw new InvalidParameterValueException("The customer gateway guest cidr list " + guestCidrList + " is invalid guest cidr!");
|
||||
String peerCidrList = cmd.getGuestCidrList();
|
||||
if (!NetUtils.isValidCidrList(peerCidrList)) {
|
||||
throw new InvalidParameterValueException("The customer gateway peer cidr list " + peerCidrList + " contains an invalid cidr!");
|
||||
}
|
||||
String ipsecPsk = cmd.getIpsecPsk();
|
||||
String ikePolicy = cmd.getIkePolicy();
|
||||
|
|
@ -214,10 +214,10 @@ public class Site2SiteVpnManagerImpl extends ManagerBase implements Site2SiteVpn
|
|||
throw new InvalidParameterValueException("The customer gateway with name " + name + " already existed!");
|
||||
}
|
||||
|
||||
checkCustomerGatewayCidrList(guestCidrList);
|
||||
checkCustomerGatewayCidrList(peerCidrList);
|
||||
|
||||
Site2SiteCustomerGatewayVO gw = new Site2SiteCustomerGatewayVO(name, accountId, owner.getDomainId(), gatewayIp, guestCidrList, ipsecPsk,
|
||||
ikePolicy, espPolicy, ikeLifetime, espLifetime, dpd);
|
||||
Site2SiteCustomerGatewayVO gw =
|
||||
new Site2SiteCustomerGatewayVO(name, accountId, owner.getDomainId(), gatewayIp, peerCidrList, ipsecPsk, ikePolicy, espPolicy, ikeLifetime, espLifetime, dpd);
|
||||
_customerGatewayDao.persist(gw);
|
||||
return gw;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue