You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ml...@apache.org on 2012/11/07 18:03:28 UTC
git commit: Summary: Fix empty traffic labels causing
NullPointerExceptions on KVM
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 <ma...@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 <ma...@betterservers.com>
Authored: Wed Nov 7 10:02:30 2012 -0700
Committer: Marcus Sorensen <ma...@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));