From nobody Mon Feb 9 21:20:55 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) client-ip=207.211.31.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 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=1593056098; cv=none; d=zohomail.com; s=zohoarc; b=R+ucUXtWHikxgG8wH6gqaq24eHMozTb/MzjBmtNDQuew2M2Qap7XX8jBMX0squbiGoVXITtJiqF0UaxkC/vZVmfvLxrf5DXkAutFsH3gSjsWN8Z3ICMy+AD7hglRggl1vj/wchw1W9CNb5NQ2y/QjcBD8GK5/FgoanggTvf2Xhc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1593056098; 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; bh=uIJcud94/cmczlSSAag5rU1218fZmBv/sg8c1hiixNA=; b=VkviF1sD9EmECufNJTrpmeEgxnH0BawATQPj1eHTQRXv7EbN7XBRPNELi12yMp6Ydj1fZMonBduI2GMl7Rg5iFouUxXCUXKapFsXXQv0E5EqyWuy2sOsxLriQ8TDyIoojJFVcYC+elLaiYvp2RwlTD9sggprDzKaohpvl82Yy38= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by mx.zohomail.com with SMTPS id 1593056098560182.68796213351266; Wed, 24 Jun 2020 20:34:58 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-377-jXIHQnoFMRis04AQyphNHA-1; Wed, 24 Jun 2020 23:34:55 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8AC438064AF; Thu, 25 Jun 2020 03:34:48 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6C6E971688; Thu, 25 Jun 2020 03:34:48 +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 3B8F4180531C; Thu, 25 Jun 2020 03:34:48 +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 05P3YZUl007947 for ; Wed, 24 Jun 2020 23:34:35 -0400 Received: by smtp.corp.redhat.com (Postfix) id 4C3A47FE8B; Thu, 25 Jun 2020 03:34:35 +0000 (UTC) Received: from vhost2.laine.org (ovpn-114-28.phx2.redhat.com [10.3.114.28]) by smtp.corp.redhat.com (Postfix) with ESMTP id 087E85BAC9 for ; Thu, 25 Jun 2020 03:34:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1593056097; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=uIJcud94/cmczlSSAag5rU1218fZmBv/sg8c1hiixNA=; b=URF10jA5ZrC0vkyPGgq/jCa4GPzwWKt1adqQUqQSLgRMGw3NFabgxX/8BNY9u1nD9N4ed+ hYPkmP08VuR8+Q8mrrs4XGF27k43pHT3PXetQenVBJh1qKATN1dooJFfzYn0wzqObKvIx8 yy0Nj6JSQMdr7TyouS+xTZVzbiXEzOc= X-MC-Unique: jXIHQnoFMRis04AQyphNHA-1 From: Laine Stump To: libvir-list@redhat.com Subject: [PATCH 23/25] nwfilter: transform logic in virNWFilterRuleInstSort to eliminate label Date: Wed, 24 Jun 2020 23:34:12 -0400 Message-Id: <20200625033414.1819594-24-laine@redhat.com> In-Reply-To: <20200625033414.1819594-1-laine@redhat.com> References: <20200625033414.1819594-1-laine@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com 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: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" This rewrite of a nested conditional produces the same results, but eliminate a goto and corresponding label. Signed-off-by: Laine Stump --- src/nwfilter/nwfilter_ebiptables_driver.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/nwfilter/nwfilter_ebiptables_driver.c b/src/nwfilter/nwfil= ter_ebiptables_driver.c index 6e05e638aa..90afbe21f1 100644 --- a/src/nwfilter/nwfilter_ebiptables_driver.c +++ b/src/nwfilter/nwfilter_ebiptables_driver.c @@ -3101,13 +3101,12 @@ virNWFilterRuleInstSort(const void *a, const void *= b) /* ensure root chain commands appear before all others since we will need them to create the child chains */ if (root_a) { - if (root_b) - goto normal; - return -1; /* a before b */ - } - if (root_b) + if (!root_b) + return -1; /* a before b */ + } else if (root_b) { return 1; /* b before a */ - normal: + } + /* priorities are limited to range [-1000, 1000] */ return insta->priority - instb->priority; } --=20 2.25.4