[ 
https://issues.apache.org/jira/browse/CLOUDSTACK-9787?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16013620#comment-16013620
 ] 

ASF subversion and git services commented on CLOUDSTACK-9787:
-------------------------------------------------------------

Commit 8b3cadb55eefeacd310f97aefbb91276e4ee8b43 in cloudstack's branch 
refs/heads/master from [~rajanik]
[ https://gitbox.apache.org/repos/asf?p=cloudstack.git;h=8b3cadb ]

Merge release branch 4.9 to master

* 4.9:
  Do not set gateway to 0.0.0.0 for windows clients
  CLOUDSTACK-9904: Fix log4j to have @AGENTLOG@ replaced
  ignore bogus default gateway   when a shared network is secondary the default 
gateway gets overwritten by a bogus one   dnsmasq does the right thing and 
replaces it with its own default which is not good for us   so check for 
'0.0.0.0'
  Activate NioTest following changes in CLOUDSTACK-9348 PR #1549
  CLOUDSTACK-9828: GetDomRVersionCommand fails to get the correct version as 
output Fix tries to return the output as a single command, instead of appending 
output from two commands
  CLOUDSTACK-3223 Exception observed while creating CPVM in VMware Setup with 
DVS
  CLOUDSTACK-9787: Fix wrong return value in NetUtils.isNetworkAWithinNetworkB


> No error message while change guest vm cidr to a large value
> ------------------------------------------------------------
>
>                 Key: CLOUDSTACK-9787
>                 URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9787
>             Project: CloudStack
>          Issue Type: Bug
>      Security Level: Public(Anyone can view this level - this is the 
> default.) 
>            Reporter: Wei Zhou
>            Assignee: Wei Zhou
>
> example
> 1. create a network with cidr = 10.1.1.32/28
> 2. edit the network and change guest vm cidr to 10.1.1.32/27
> according to server/src/com/cloud/network/NetworkServiceImpl.java
> {code}
>             if (networkCidr != null) {
>                 if (!NetUtils.isNetworkAWithinNetworkB(guestVmCidr, 
> networkCidr)) {
>                     throw new InvalidParameterValueException("Invalid value 
> of Guest VM CIDR. For IP Reservation, Guest VM CIDR  should be a subset of 
> network CIDR : "
>                             + networkCidr);
>                 }
>             } else {
>                 if (!NetUtils.isNetworkAWithinNetworkB(guestVmCidr, 
> network.getCidr())) {
>                     throw new InvalidParameterValueException("Invalid value 
> of Guest VM CIDR. For IP Reservation, Guest VM CIDR  should be a subset of 
> network CIDR :  "
>                             + network.getCidr());
>                 }
>             }
> {code}
> this should throw an exception, however it does not.
> I added some unit test in 
> utils/src/test/java/com/cloud/utils/net/NetUtilsTest.java
> {code}
>     @Test
>     public void testIsNetworkAWithinNetworkB() {
>         assertTrue(NetUtils.isNetworkAWithinNetworkB("192.168.30.0/24", 
> "192.168.30.0/23"));
>         assertTrue(NetUtils.isNetworkAWithinNetworkB("192.168.30.0/24", 
> "192.168.30.0/22"));
>         assertFalse(NetUtils.isNetworkAWithinNetworkB("192.168.30.0/23", 
> "192.168.30.0/24"));
>         assertFalse(NetUtils.isNetworkAWithinNetworkB("192.168.30.0/22", 
> "192.168.30.0/24"));
>         assertTrue(NetUtils.isNetworkAWithinNetworkB("192.168.28.0/24", 
> "192.168.28.0/23"));
>         assertTrue(NetUtils.isNetworkAWithinNetworkB("192.168.28.0/24", 
> "192.168.28.0/22"));
>         assertFalse(NetUtils.isNetworkAWithinNetworkB("192.168.28.0/23", 
> "192.168.28.0/24"));
>         assertFalse(NetUtils.isNetworkAWithinNetworkB("192.168.28.0/22", 
> "192.168.28.0/24"));
>         assertTrue(NetUtils.isNetworkAWithinNetworkB("192.168.30.0/24", 
> "192.168.28.0/22"));
>     }
> {code}
> the test fails at 
>         assertFalse(NetUtils.isNetworkAWithinNetworkB("192.168.30.0/23", 
> "192.168.30.0/24"));



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to