Applying fix from commit id 6b8e0baa21e6cffc62eb2d35eecc7aeb2087d1c1 Changes by Edilson Su: if vpc public network with snat enabled, then will triger this issue.
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/2ed64b23 Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/2ed64b23 Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/2ed64b23 Branch: refs/heads/master Commit: 2ed64b2356143d8b70a343b71424ebfd31badc71 Parents: db86bdf Author: wilderrodrigues <wrodrig...@schubergphilis.com> Authored: Tue Oct 14 15:10:14 2014 +0200 Committer: wilderrodrigues <wrodrig...@schubergphilis.com> Committed: Tue Oct 14 15:10:14 2014 +0200 ---------------------------------------------------------------------- .../src/com/cloud/network/router/CommandSetupHelper.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2ed64b23/server/src/com/cloud/network/router/CommandSetupHelper.java ---------------------------------------------------------------------- diff --git a/server/src/com/cloud/network/router/CommandSetupHelper.java b/server/src/com/cloud/network/router/CommandSetupHelper.java index 7ef04ad..727df8a 100644 --- a/server/src/com/cloud/network/router/CommandSetupHelper.java +++ b/server/src/com/cloud/network/router/CommandSetupHelper.java @@ -223,7 +223,7 @@ public class CommandSetupHelper { String gatewayIp = nic.getGateway(); if (!nic.isDefaultNic()) { - GuestOSVO guestOS = _guestOSDao.findById(vm.getGuestOSId()); + final GuestOSVO guestOS = _guestOSDao.findById(vm.getGuestOSId()); if (guestOS == null || !guestOS.getDisplayName().toLowerCase().contains("windows")) { gatewayIp = "0.0.0.0"; } @@ -651,7 +651,7 @@ public class CommandSetupHelper { } public void createStaticRouteCommands(final List<StaticRouteProfile> staticRoutes, final VirtualRouter router, final Commands cmds) { - SetStaticRouteCommand cmd = new SetStaticRouteCommand(staticRoutes); + final SetStaticRouteCommand cmd = new SetStaticRouteCommand(staticRoutes); cmd.setAccessDetail(NetworkElementCommand.ROUTER_IP, _routerControlHelper.getRouterControlIp(router.getId())); cmd.setAccessDetail(NetworkElementCommand.ROUTER_NAME, router.getInstanceName()); final DataCenterVO dcVo = _dcDao.findById(router.getDataCenterId()); @@ -672,7 +672,7 @@ public class CommandSetupHelper { final String cidr; final Network network = _networkDao.findById(vpn.getNetworkId()); if (network == null) { - Vpc vpc = _vpcDao.findById(vpn.getVpcId()); + final Vpc vpc = _vpcDao.findById(vpn.getVpcId()); cidr = vpc.getCidr(); } else { cidr = network.getCidr(); @@ -778,8 +778,8 @@ public class CommandSetupHelper { final String macAddress = vlanMacAddress.get(BroadcastDomainType.getValue(BroadcastDomainType.fromString(ipAddr.getVlanTag()))); - final IpAddressTO ip = new IpAddressTO(ipAddr.getAccountId(), ipAddr.getAddress().addr(), add, false, ipAddr.isSourceNat(), ipAddr.getVlanTag(), - ipAddr.getGateway(), ipAddr.getNetmask(), macAddress, networkRate, ipAddr.isOneToOneNat()); + final IpAddressTO ip = new IpAddressTO(ipAddr.getAccountId(), ipAddr.getAddress().addr(), add, false, ipAddr.isSourceNat(), BroadcastDomainType.fromString(ipAddr.getVlanTag()).toString(), ipAddr.getGateway(), + ipAddr.getNetmask(), macAddress, networkRate, ipAddr.isOneToOneNat()); ip.setTrafficType(network.getTrafficType()); ip.setNetworkName(_networkModel.getNetworkTag(router.getHypervisorType(), network));