From nobody Mon Feb 9 14:02:48 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=1558355923; cv=none; d=zoho.com; s=zohoarc; b=kdIZVXDopj8uFYpamqWia9dVpsHy+TsPk110r/kuAWQtASzjRQIt9SbAviC42mV5xhHb2zD8z7gamMCulfIO5wT8OCwCNxu1EVYTDSefqHbvtfkAj+DDTV/GCKmwCuSr5tOMSkOZzzDUN6vVbD5ol/JIuFFO46HiEv/LOD49J7E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1558355923; 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=2rtduFHuXvivbUCWQ7JcxJsaWC8YaJVLJ+pwAmwzBK8=; b=NKmb8F2CBV45mepWd/IGWZaDy/sGKtcYHKloPw/5z51796Npgj7m3AjB3zmjxK8lNrK0u5qyJL9IUQBvlZLLH+TDBycoMrg2HaJnC6WKc2lOrOBnjGD5jmwIVfCKtkkTPbm7Fw/au4Mll5wKnS5BY4CjvSy/x5izhE75jjUwygc= 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 1558355923233823.8061443355704; Mon, 20 May 2019 05:38:43 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2BB47308FEC6; Mon, 20 May 2019 12:38:21 +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 5DEB160CD1; Mon, 20 May 2019 12:38:16 +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 D59685B424; Mon, 20 May 2019 12:38:11 +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 x4KCcAqr031915 for ; Mon, 20 May 2019 08:38:10 -0400 Received: by smtp.corp.redhat.com (Postfix) id 46BAE2FC58; Mon, 20 May 2019 12:38:10 +0000 (UTC) Received: from moe.brq.redhat.com (unknown [10.43.2.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id C4F7F5D704 for ; Mon, 20 May 2019 12:38:09 +0000 (UTC) From: Michal Privoznik To: libvir-list@redhat.com Date: Mon, 20 May 2019 14:37:59 +0200 Message-Id: <62b57112432c2d99af7ae73e75b4131505096f11.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 2/6] networkStartNetworkVirtual: Dissolve 'err4' 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.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.49]); Mon, 20 May 2019 12:38:36 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Signed-off-by: Michal Privoznik --- src/network/bridge_driver.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c index ef82a3e310..88e49969b5 100644 --- a/src/network/bridge_driver.c +++ b/src/network/bridge_driver.c @@ -2335,7 +2335,7 @@ networkStartNetworkVirtual(virNetworkDriverStatePtr d= river, virMacMapPtr macmap; char *macMapFile =3D NULL; int tapfd =3D -1; - pid_t dnsmasqPid; + bool dnsmasqStarted =3D false; =20 /* Check to see if any network IP collides with an existing route */ if (networkCheckRouteCollision(def) < 0) @@ -2465,22 +2465,24 @@ networkStartNetworkVirtual(virNetworkDriverStatePtr= driver, networkStartDhcpDaemon(driver, obj) < 0) goto err3; =20 + dnsmasqStarted =3D true; + /* start radvd if there are any ipv6 addresses */ if (v6present && networkStartRadvd(driver, obj) < 0) - goto err4; + goto error; =20 /* dnsmasq does not wait for DAD to complete before daemonizing, * so we need to wait for it ourselves. */ if (v6present && networkWaitDadFinish(obj) < 0) - goto err4; + goto error; =20 /* DAD has finished, dnsmasq is now bound to the * bridge's IPv6 address, so we can set the dummy tun down. */ if (tapfd >=3D 0) { if (virNetDevSetOnline(macTapIfName, false) < 0) - goto err4; + goto error; VIR_FORCE_CLOSE(tapfd); } =20 @@ -2497,12 +2499,8 @@ networkStartNetworkVirtual(virNetworkDriverStatePtr = driver, if (def->bandwidth) virNetDevBandwidthClear(def->bridge); =20 - err4: - if (!save_err) - virErrorPreserveLast(&save_err); - - dnsmasqPid =3D virNetworkObjGetDnsmasqPid(obj); - if (dnsmasqPid > 0) { + if (dnsmasqStarted) { + pid_t dnsmasqPid =3D virNetworkObjGetDnsmasqPid(obj); kill(dnsmasqPid, SIGTERM); virNetworkObjSetDnsmasqPid(obj, -1); } --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list