Repository: cloudstack
Updated Branches:
  refs/heads/master f1f79586d -> df1e3998f


CLOUDSTACK-6079:
fixed issue: if public traffic is on a physical network isolated by VLAN,
and guest traffic is on an another physical network isolated by VXLAN,
public traffic's broadcast type is updated to VXLAN by mistake.

submitted-by: [email protected]


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

Branch: refs/heads/master
Commit: df1e3998ff64668e82604d2519f93de7d5f856fe
Parents: f1f7958
Author: Marcus Sorensen <[email protected]>
Authored: Thu Feb 20 23:23:58 2014 -0700
Committer: Marcus Sorensen <[email protected]>
Committed: Thu Feb 20 23:28:19 2014 -0700

----------------------------------------------------------------------
 .../com/cloud/network/NetworkServiceImpl.java   | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/df1e3998/server/src/com/cloud/network/NetworkServiceImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/NetworkServiceImpl.java 
b/server/src/com/cloud/network/NetworkServiceImpl.java
index 2c673d2..c42d421 100755
--- a/server/src/com/cloud/network/NetworkServiceImpl.java
+++ b/server/src/com/cloud/network/NetworkServiceImpl.java
@@ -3588,15 +3588,17 @@ public class NetworkServiceImpl extends ManagerBase 
implements NetworkService {
 
             // For public traffic, get isolation method of physical network 
and update the public network accordingly
             // each broadcast type will individually need to be qualified for 
support of public traffic
-            List<String> isolationMethods = network.getIsolationMethods();
-            if ((isolationMethods.size() == 1 && 
isolationMethods.get(0).toLowerCase().equals("vxlan"))
-                || (isolationMethod != null && 
isolationMethods.contains(isolationMethod) && 
isolationMethod.toLowerCase().equals("vxlan"))) {
-                // find row in networks table that is defined as 'Public', 
created when zone was deployed
-                NetworkVO publicNetwork = 
_networksDao.listByZoneAndTrafficType(network.getDataCenterId(),TrafficType.Public).get(0);
-                if (publicNetwork != null) {
-                    s_logger.debug("setting public network " + publicNetwork + 
" to broadcast type vxlan");
-                    
publicNetwork.setBroadcastDomainType(BroadcastDomainType.Vxlan);
-                    _networksDao.persist(publicNetwork);
+            if (TrafficType.Public.equals(trafficType)){
+                List<String> isolationMethods = network.getIsolationMethods();
+                if ((isolationMethods.size() == 1 && 
isolationMethods.get(0).toLowerCase().equals("vxlan"))
+                        || (isolationMethod != null && 
isolationMethods.contains(isolationMethod) && 
isolationMethod.toLowerCase().equals("vxlan"))) {
+                    // find row in networks table that is defined as 'Public', 
created when zone was deployed
+                    NetworkVO publicNetwork = 
_networksDao.listByZoneAndTrafficType(network.getDataCenterId(),TrafficType.Public).get(0);
+                    if (publicNetwork != null) {
+                        s_logger.debug("setting public network " + 
publicNetwork + " to broadcast type vxlan");
+                        
publicNetwork.setBroadcastDomainType(BroadcastDomainType.Vxlan);
+                        _networksDao.persist(publicNetwork);
+                    }
                 }
             }
 

Reply via email to