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)
This commit is contained in:
parent
8cb2a87815
commit
86aff86b78
|
|
@ -48,7 +48,7 @@ public class CreateVpnCustomerGatewayCmd extends BaseAsyncCmd {
|
|||
private String gatewayIp;
|
||||
|
||||
@Parameter(name = ApiConstants.CIDR_LIST, type = CommandType.STRING, required = true, description = "guest cidr list of the customer gateway")
|
||||
private String guestCidrList;
|
||||
private String peerCidrList;
|
||||
|
||||
@Parameter(name = ApiConstants.IPSEC_PSK, type = CommandType.STRING, required = true, description = "IPsec Preshared-Key of the customer gateway")
|
||||
private String ipsecPsk;
|
||||
|
|
@ -97,7 +97,7 @@ public class CreateVpnCustomerGatewayCmd extends BaseAsyncCmd {
|
|||
}
|
||||
|
||||
public String getGuestCidrList() {
|
||||
return guestCidrList;
|
||||
return peerCidrList;
|
||||
}
|
||||
|
||||
public String getGatewayIp() {
|
||||
|
|
|
|||
|
|
@ -185,9 +185,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();
|
||||
|
|
@ -228,10 +228,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);
|
||||
new Site2SiteCustomerGatewayVO(name, accountId, owner.getDomainId(), gatewayIp, peerCidrList, ipsecPsk, ikePolicy, espPolicy, ikeLifetime, espLifetime, dpd);
|
||||
_customerGatewayDao.persist(gw);
|
||||
return gw;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue