Return-Path: X-Original-To: apmail-incubator-cloudstack-commits-archive@minotaur.apache.org Delivered-To: apmail-incubator-cloudstack-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 03025D8E0 for ; Wed, 7 Nov 2012 17:03:29 +0000 (UTC) Received: (qmail 42928 invoked by uid 500); 7 Nov 2012 17:03:28 -0000 Delivered-To: apmail-incubator-cloudstack-commits-archive@incubator.apache.org Received: (qmail 42794 invoked by uid 500); 7 Nov 2012 17:03:28 -0000 Mailing-List: contact cloudstack-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: cloudstack-dev@incubator.apache.org Delivered-To: mailing list cloudstack-commits@incubator.apache.org Received: (qmail 42786 invoked by uid 99); 7 Nov 2012 17:03:28 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 07 Nov 2012 17:03:28 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 2386D45214; Wed, 7 Nov 2012 17:03:28 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: mlsorensen@apache.org To: cloudstack-commits@incubator.apache.org X-Mailer: ASF-Git Admin Mailer Subject: git commit: Summary: Fix empty traffic labels causing NullPointerExceptions on KVM Message-Id: <20121107170328.2386D45214@tyr.zones.apache.org> Date: Wed, 7 Nov 2012 17:03:28 +0000 (UTC) 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 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 Authored: Wed Nov 7 10:02:30 2012 -0700 Committer: Marcus Sorensen 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));