Skip to content

Commit cbd3662

Browse files
authored
Merge pull request #2055 from shapeblue/sharedisolated
CLOUDSTACK-9887 ignore bogus default gateway
2 parents 9c4eb95 + 2e926d8 commit cbd3662

File tree

2 files changed

+4
-13
lines changed

2 files changed

+4
-13
lines changed

server/src/com/cloud/network/router/CommandSetupHelper.java

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,6 @@
108108
import com.cloud.offerings.NetworkOfferingVO;
109109
import com.cloud.offerings.dao.NetworkOfferingDao;
110110
import com.cloud.service.dao.ServiceOfferingDao;
111-
import com.cloud.storage.GuestOSVO;
112-
import com.cloud.storage.dao.GuestOSDao;
113111
import com.cloud.user.Account;
114112
import com.cloud.uservm.UserVm;
115113
import com.cloud.utils.Pair;
@@ -174,8 +172,6 @@ public class CommandSetupHelper {
174172
private VlanDao _vlanDao;
175173
@Inject
176174
private IPAddressDao _ipAddressDao;
177-
@Inject
178-
private GuestOSDao _guestOSDao;
179175

180176
@Inject
181177
private RouterControlHelper _routerControlHelper;
@@ -219,12 +215,6 @@ public void createDhcpEntryCommand(final VirtualRouter router, final UserVm vm,
219215
_networkModel.getExecuteInSeqNtwkElmtCmd());
220216

221217
String gatewayIp = nic.getIPv4Gateway();
222-
if (!nic.isDefaultNic()) {
223-
final GuestOSVO guestOS = _guestOSDao.findById(vm.getGuestOSId());
224-
if (guestOS == null || !guestOS.getDisplayName().toLowerCase().contains("windows")) {
225-
gatewayIp = "0.0.0.0";
226-
}
227-
}
228218

229219
final DataCenterVO dcVo = _dcDao.findById(router.getDataCenterId());
230220

systemvm/patches/debian/config/opt/cloud/bin/cs/CsDhcp.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,10 @@ def configure_server(self):
8989
gateway = gn.get_gateway()
9090
else:
9191
gateway = i['gateway']
92-
sline = "dhcp-option=tag:interface-%s-%s,3," % (device, idx)
93-
line = "dhcp-option=tag:interface-%s-%s,3,%s" % (device, idx, gateway)
94-
self.conf.search(sline, line)
92+
if gateway != '0.0.0.0':
93+
sline = "dhcp-option=tag:interface-%s-%s,3," % (device, idx)
94+
line = "dhcp-option=tag:interface-%s-%s,3,%s" % (device, idx, gateway)
95+
self.conf.search(sline, line)
9596
# Netmask
9697
netmask = ''
9798
if self.config.is_vpc():

0 commit comments

Comments
 (0)