Skip to content

Commit 3d213b6

Browse files
committed
Merge pull request #916 from kansal/CLOUDSTACK-8940
CLOUDSTACK-8940: Wrong value is inserted into nics table netmask field when creating a VM - Fixed Problem: When creating a VM in shared network with no service, the value of netmask is added in the table in the CIDR format unlike other cases where it is added as normal string in the format xxx.xxx.xxx.xxx. The netmask column in the nics table has a length of 15 chars which gets violated if the CIDR exceeds it(Max CIDR length can be 18). Fix: Before storing the netmask convert from CIDR to native format. * pr/916: CLOUDSTACK-8940: Wrong value is inserted into nics table netmask field when creating a VM - Fixed Signed-off-by: Remi Bergsma <github@remi.nl>
2 parents abbdb2e + ba26efc commit 3d213b6

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎server/src/com/cloud/network/IpAddressManagerImpl.java‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1932,9 +1932,9 @@ public void doInTransactionWithoutResult(TransactionStatus status) throws Insuff
19321932

19331933
}
19341934

1935-
// nic ip address isn ot set here. Because the DHCP is external to cloudstack
1935+
// nic ip address is not set here. Because the DHCP is external to cloudstack
19361936
nic.setIPv4Gateway(network.getGateway());
1937-
nic.setIPv4Netmask(network.getCidr());
1937+
nic.setIPv4Netmask(NetUtils.getCidrNetmask(network.getCidr()));
19381938

19391939
List<VlanVO> vlan = _vlanDao.listVlansByNetworkId(network.getId());
19401940

0 commit comments

Comments
 (0)