Skip to content

Commit a68680a

Browse files
jeanjean
authored andcommitted
Fix VPC restart with multi-CIDR networks: handle comma-separated CIDR in NetworkVO.equals()
When a network has multiple CIDRs (e.g. '192.168.2.0/24,160.0.0.0/24'), NetworkVO.equals() passes the raw comma-separated string to NetUtils.isNetworkAWithinNetworkB() which expects a single CIDR, causing 'cidr is not formatted correctly' error during VPC restart with cleanup=true. Extract only the first CIDR value before passing to NetUtils.
1 parent 7aa0558 commit a68680a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

engine/schema/src/main/java/com/cloud/network/dao/NetworkVO.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -600,7 +600,9 @@ public boolean equals(Object obj) {
600600
return true;
601601
}
602602

603-
return NetUtils.isNetworkAWithinNetworkB(cidr, that.cidr);
603+
return NetUtils.isNetworkAWithinNetworkB(
604+
com.cloud.utils.StringUtils.getFirstValueFromCommaSeparatedString(cidr),
605+
com.cloud.utils.StringUtils.getFirstValueFromCommaSeparatedString(that.cidr));
604606
}
605607

606608
@Override

0 commit comments

Comments
 (0)