incubator-cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mlsoren...@apache.org
Subject git commit: Summary: Fix empty traffic labels causing NullPointerExceptions on KVM
Date Wed, 07 Nov 2012 17:03:28 GMT
Updated Branches:
  refs/heads/master 6c411fb24 -> b42f3f53d


Summary: Fix empty traffic labels causing NullPointerExceptions on KVM

Detail: In com.cloud.hypervisor.kvm.resource.BridgeVifDriver.java, in 2 places
an if block should have evaluated to true if trafficLabel was null, however it
was causing a NullPointerException instead.

BUG-ID : NONE
Bugfix-for: 4.0
Reviewed-by: Marcus Sorensen
Reported-by: Dave Cahill
Signed-off-by: Marcus Sorensen <marcus@betterservers.com> 1352307750 -0700


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

Branch: refs/heads/master
Commit: b42f3f53d8f1b1c1b8c9d151cc9b93d44a255afa
Parents: 6c411fb
Author: Marcus Sorensen <marcus@betterservers.com>
Authored: Wed Nov 7 10:02:30 2012 -0700
Committer: Marcus Sorensen <marcus@betterservers.com>
Committed: Wed Nov 7 10:02:30 2012 -0700

----------------------------------------------------------------------
 .../hypervisor/kvm/resource/BridgeVifDriver.java   |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/b42f3f53/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/BridgeVifDriver.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/BridgeVifDriver.java
b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/BridgeVifDriver.java
index 116c09d..e6f2f7f 100644
--- a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/BridgeVifDriver.java
+++ b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/BridgeVifDriver.java
@@ -89,7 +89,7 @@ public class BridgeVifDriver extends VifDriverBase {
         if (nic.getType() == Networks.TrafficType.Guest) {
             if (nic.getBroadcastType() == Networks.BroadcastDomainType.Vlan
                     && !vlanId.equalsIgnoreCase("untagged")) {
-                if(trafficLabel != null || !trafficLabel.isEmpty()) {
+                if(trafficLabel != null && !trafficLabel.isEmpty()) {
                     s_logger.debug("creating a vlan dev and bridge for guest traffic per
traffic label " + trafficLabel);
                     String brName = createVlanBr(vlanId, _pifs.get(trafficLabel));
                     intf.defBridgeNet(brName, null, nic.getMac(), getGuestNicModel(guestOsType));
@@ -107,7 +107,7 @@ public class BridgeVifDriver extends VifDriverBase {
         } else if (nic.getType() == Networks.TrafficType.Public) {
             if (nic.getBroadcastType() == Networks.BroadcastDomainType.Vlan
                     && !vlanId.equalsIgnoreCase("untagged")) {
-                if(trafficLabel != null || !trafficLabel.isEmpty()){
+                if(trafficLabel != null && !trafficLabel.isEmpty()){
                     s_logger.debug("creating a vlan dev and bridge for public traffic per
traffic label " + trafficLabel);
                     String brName = createVlanBr(vlanId, _pifs.get(trafficLabel));
                     intf.defBridgeNet(brName, null, nic.getMac(), getGuestNicModel(guestOsType));


Mime
View raw message