mirror of https://github.com/apache/cloudstack.git
When deleting proxy ARP entries, first check that no static/source/destination NAT rules use them
This commit is contained in:
parent
8de95f1215
commit
6534620208
|
|
@ -1546,17 +1546,16 @@ public class JuniperSrxResource implements ServerResource {
|
|||
return sendRequestAndCheckResponse(command, xml, "name", publicIp + "/32");
|
||||
|
||||
case CHECK_IF_IN_USE:
|
||||
// Check if any static or destination NAT rules use this proxy ARP entry
|
||||
List<String[]> staticAndDestNatRules = getAllStaticAndDestNatRules();
|
||||
|
||||
for (String[] rule : staticAndDestNatRules) {
|
||||
String rulePublicIp = rule[0];
|
||||
if (publicIp.equals(rulePublicIp)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
// Check if any NAT rules are using this proxy ARP entry
|
||||
String poolName = genSourceNatPoolName(publicIp);
|
||||
|
||||
String allStaticNatRules = sendRequest(SrxXml.STATIC_NAT_RULE_GETALL.getXml());
|
||||
String allDestNatRules = sendRequest(replaceXmlValue(SrxXml.DEST_NAT_RULE_GETALL.getXml(), "rule-set", _publicZone));
|
||||
String allSrcNatRules = sendRequest(SrxXml.SRC_NAT_RULE_GETALL.getXml());
|
||||
|
||||
return (allStaticNatRules.contains(publicIp) ||
|
||||
allDestNatRules.contains(publicIp) ||
|
||||
allSrcNatRules.contains(poolName));
|
||||
|
||||
case ADD:
|
||||
if (manageProxyArp(SrxCommand.CHECK_IF_EXISTS, publicVlanTag, publicIp)) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue