Skip to content

Commit 18e8375

Browse files
authored
Hiding system reserved IP addresses (#4408)
This PR removes system reserved IP addresses from the options of acquiring IP addresses. Choosing any reserved IP address results in an error. The IP addresses should not have been displayed in the first place. Fixes: #4310
1 parent 3ab43e2 commit 18e8375

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

server/src/main/java/com/cloud/server/ManagementServerImpl.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1998,6 +1998,7 @@ public Pair<List<? extends IpAddress>, Integer> searchForIPAddresses(final ListP
19981998
sb.and("vpcId", sb.entity().getVpcId(), SearchCriteria.Op.EQ);
19991999
sb.and("state", sb.entity().getState(), SearchCriteria.Op.EQ);
20002000
sb.and("display", sb.entity().isDisplay(), SearchCriteria.Op.EQ);
2001+
sb.and("forsystemvms", sb.entity().isForSystemVms(), SearchCriteria.Op.EQ);
20012002

20022003
if (forLoadBalancing != null && forLoadBalancing) {
20032004
final SearchBuilder<LoadBalancerVO> lbSearch = _loadbalancerDao.createSearchBuilder();
@@ -2106,6 +2107,7 @@ public Pair<List<? extends IpAddress>, Integer> searchForIPAddresses(final ListP
21062107
sc.setParameters("state", state);
21072108
}
21082109

2110+
sc.setParameters( "forsystemvms", false);
21092111
final Pair<List<IPAddressVO>, Integer> result = _publicIpAddressDao.searchAndCount(sc, searchFilter);
21102112
return new Pair<List<? extends IpAddress>, Integer>(result.first(), result.second());
21112113
}

0 commit comments

Comments
 (0)