cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mc...@apache.org
Subject [5/9] git commit: CLOUDSTACK-985: Make sure RvR would always have same MAC address
Date Wed, 16 Jan 2013 02:19:09 GMT
CLOUDSTACK-985: Make sure RvR would always have same MAC address

Even with newly created RvR using "restartNetwork&cleanup=false" API.


Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/4f889bd4
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/4f889bd4
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/4f889bd4

Branch: refs/heads/api_limit
Commit: 4f889bd426ea841918b570bb008cf5e348715730
Parents: c32dbec
Author: Sheng Yang <sheng.yang@citrix.com>
Authored: Tue Jan 15 15:22:41 2013 -0800
Committer: Sheng Yang <sheng.yang@citrix.com>
Committed: Tue Jan 15 15:22:41 2013 -0800

----------------------------------------------------------------------
 .../router/VirtualNetworkApplianceManagerImpl.java |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/4f889bd4/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java b/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
index c8fd86e..717da05 100755
--- a/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
+++ b/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
@@ -1699,6 +1699,13 @@ public class VirtualNetworkApplianceManagerImpl implements VirtualNetworkApplian
             }
             NetworkOfferingVO publicOffering = _networkMgr.getSystemAccountNetworkOfferings(NetworkOfferingVO.SystemPublicNetwork).get(0);
             List<NetworkVO> publicNetworks = _networkMgr.setupNetwork(_systemAcct,
publicOffering, plan, null, null, false);
+            String publicIp = defaultNic.getIp4Address();
+            // We want to use the identical MAC address for RvR on public interface if possible
+            NicVO peerNic = _nicDao.findByIp4AddressAndNetworkId(publicIp, publicNetworks.get(0).getId());
+            if (peerNic != null) {
+                s_logger.info("Use same MAC as previous RvR, the MAC is " + peerNic.getMacAddress());
+                defaultNic.setMacAddress(peerNic.getMacAddress());
+            }
             networks.add(new Pair<NetworkVO, NicProfile>(publicNetworks.get(0), defaultNic));
         }
 


Mime
View raw message