weizhouapache commented on code in PR #10174:
URL: https://github.com/apache/cloudstack/pull/10174#discussion_r1909051637


##########
utils/src/main/java/com/cloud/utils/net/NetUtils.java:
##########
@@ -574,7 +574,7 @@ public static boolean isValidIp4Cidr(final String cidr) {
 
         final String[] cidrPair = cidr.split("\\/");
         if (cidrPair.length != 2) {
-            return false;
+            return isValidIp4(cidr); // we consider an ip4v address as a valid 
/32 cidr

Review Comment:
   I would suggest to revisit the checks in the code snippet below
   
   
https://github.com/apache/cloudstack/blob/fadb39ece73775e3aadbe715ca428b24e256af34/services/secondary-storage/controller/src/main/java/org/apache/cloudstack/secondarystorage/SecondaryStorageManagerImpl.java#L402-L409
   
   line 403 may be replaced by two code blocks. (if and else if)
   in line 404, check should be inverted
   in line 405, we should use `NetUtils.getCleanIp4Cidr(cidr)` instead of `cidr`



-- 
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: commits-unsubscr...@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to