From nobody Mon Feb 9 08:30:50 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1558355944; cv=none; d=zoho.com; s=zohoarc; b=CMRr79snIkucWwuXvtSe+ohr08l1X1n6J5LYcK9p8L60uznS3Qo+SyI0ym+wQcMUXeWbCkIXR12l5NCd+JJL060uHbB4r6gOEBP3hy+QuZLwHsDqOHDS9p+PqEj//K1PrgCh1TLdBZvdeFoQrn58uwHcYWhUt3Xmr120KilveeY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1558355944; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=o/ouH1CZbcOuSLflsROgbPkuuQm8KJ6Yj7uqC4YqMfc=; b=RWXWm6a51DYcZd5h2H2VkMjIGZg44pegnBM6RUKlDFCmzM0X+VS6vFCDn8tj4DOzA7TNK1SiewdiK6OLm8Yo6rYWa9RH/3ad8DyGAtRfQDR+w1iWA0pt+2TXrYora2s/VPdKA6lMNSty4G7lZbo7V9cEzgSnbzMWLNR4Uvrh7Pw= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1558355944904427.4005066044724; Mon, 20 May 2019 05:39:04 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2970A356E7; Mon, 20 May 2019 12:39:03 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 677875DE8A; Mon, 20 May 2019 12:39:02 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 2446D5B429; Mon, 20 May 2019 12:39:01 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x4KCcBdY031935 for ; Mon, 20 May 2019 08:38:11 -0400 Received: by smtp.corp.redhat.com (Postfix) id D9AFA5D6A6; Mon, 20 May 2019 12:38:11 +0000 (UTC) Received: from moe.brq.redhat.com (unknown [10.43.2.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id 619B95D704 for ; Mon, 20 May 2019 12:38:11 +0000 (UTC) From: Michal Privoznik To: libvir-list@redhat.com Date: Mon, 20 May 2019 14:38:01 +0200 Message-Id: <5d2c80b4b7b96229390b0be26596961d9018cfc8.1558355839.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 4/6] networkStartNetworkVirtual: Dissolve 'err2' label in 'error' X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Mon, 20 May 2019 12:39:03 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Signed-off-by: Michal Privoznik --- src/network/bridge_driver.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c index cd59039bdb..4c920d1fdd 100644 --- a/src/network/bridge_driver.c +++ b/src/network/bridge_driver.c @@ -2337,6 +2337,7 @@ networkStartNetworkVirtual(virNetworkDriverStatePtr d= river, int tapfd =3D -1; bool dnsmasqStarted =3D false; bool devOnline =3D false; + bool firewalRulesAdded =3D false; =20 /* Check to see if any network IP collides with an existing route */ if (networkCheckRouteCollision(def) < 0) @@ -2413,6 +2414,8 @@ networkStartNetworkVirtual(virNetworkDriverStatePtr d= river, networkAddFirewallRules(def) < 0) goto err1; =20 + firewalRulesAdded =3D true; + for (i =3D 0; (ipdef =3D virNetworkDefGetIPByIndex(def, AF_UNSPEC, i))= ; i++) { if (VIR_SOCKET_ADDR_IS_FAMILY(&ipdef->address, AF_INET)) v4present =3D true; @@ -2421,15 +2424,15 @@ networkStartNetworkVirtual(virNetworkDriverStatePtr= driver, =20 /* Add the IP address/netmask to the bridge */ if (networkAddAddrToBridge(obj, ipdef) < 0) - goto err2; + goto error; } =20 if (networkStartHandleMACTableManagerMode(obj, macTapIfName) < 0) - goto err2; + goto error; =20 /* Bring up the bridge interface */ if (virNetDevSetOnline(def->bridge, 1) < 0) - goto err2; + goto error; =20 devOnline =3D true; =20 @@ -2511,10 +2514,8 @@ networkStartNetworkVirtual(virNetworkDriverStatePtr = driver, if (devOnline) ignore_value(virNetDevSetOnline(def->bridge, 0)); =20 - err2: - if (!save_err) - virErrorPreserveLast(&save_err); - if (def->forward.type !=3D VIR_NETWORK_FORWARD_OPEN) + if (firewalRulesAdded && + def->forward.type !=3D VIR_NETWORK_FORWARD_OPEN) networkRemoveFirewallRules(def); =20 err1: --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list