From 0165f915b6021f7acf7fc5efb24b4408aa048a73 Mon Sep 17 00:00:00 2001 From: keshav Date: Fri, 5 Aug 2011 16:51:58 -0700 Subject: [PATCH] Changed findOrCreateDhcpServers() to check if start IP is null before retrieving an IP address object --- .../network/router/VirtualNetworkApplianceManagerImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java b/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java index f8f8dcd0b70..9683c331cea 100755 --- a/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java +++ b/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java @@ -1080,7 +1080,7 @@ public class VirtualNetworkApplianceManagerImpl implements VirtualNetworkApplian String defaultNetworkStartIp = null; if (guestNetwork.getCidr() != null) { String startIp = _networkMgr.getStartIpAddress(guestNetwork.getId()); - if (_ipAddressDao.findByIpAndSourceNetworkId(guestNetwork.getId(), startIp).getAllocatedTime() == null) { + if (startIp != null && _ipAddressDao.findByIpAndSourceNetworkId(guestNetwork.getId(), startIp).getAllocatedTime() == null) { defaultNetworkStartIp = startIp; } else if (s_logger.isDebugEnabled()){ s_logger.debug("First ip " + startIp + " in network id=" + guestNetwork.getId() + " is already allocated, can't use it for domain router; will get random ip address from the range");