Copilot commented on code in PR #13397:
URL: https://github.com/apache/cloudstack/pull/13397#discussion_r3394549936
##########
engine/schema/src/main/java/com/cloud/network/dao/FirewallRulesDaoImpl.java:
##########
@@ -121,6 +122,17 @@ protected FirewallRulesDaoImpl() {
RoutingFirewallRulesSearch.done();
}
+ @PostConstruct
+ public void init() {
+ SearchBuilder<IPAddressVO> IpSearch = _ipDao.createSearchBuilder();
+ IpSearch.and("associatedWithVmId",
IpSearch.entity().getAssociatedWithVmId(), SearchCriteria.Op.EQ);
+ IpSearch.and("oneToOneNat", IpSearch.entity().isOneToOneNat(),
SearchCriteria.Op.NNULL);
Review Comment:
`one_to_one_nat` is defined as `NOT NULL default 0` in the DB schema, so
using `Op.NNULL` here does not filter anything (and doesn't actually ensure the
IP is static-NAT enabled). If the intent is to only match static NAT IPs,
compare explicitly to `true` (or remove the condition if it’s redundant with
`vm_id`).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]