From nobody Fri Dec 12 14:08:55 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass(p=reject dis=none) header.from=lists.libvirt.org ARC-Seal: i=1; a=rsa-sha256; t=1764251924; cv=none; d=zohomail.com; s=zohoarc; b=IonT0af5VKACsBKwaUAdkDn019opSKPHx/xQMFZ5XUpH4F8IZIthyp6ZegU/rvwZNlvrtnvUuQp+406VpizPvQTGLX7LzNlgqDmveUD4AWfjtlXGhhY9NQBK+gO4bekTnsP/q9jQOe0/qbr6APPlXOyiC9BZwINbMB+xoNaIsBs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1764251924; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Owner:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Subject:Subject:To:To:Message-Id:Cc; bh=Bcn3fbt8ukUAPNr8SqrQtTJydOFjD5pH80YVeMWKCUc=; b=jbgel9FYHEYLjRidjC6+sGBnKEIssxpkLDtro1QEg11cW3QWPTocOp7chFgtp5MylLplQdEBERqQBLEor2uL0R7/slRWCiuoQajeFc/viMqDCgHhIRg4rjX8dJGjHLF4AdG2zWYcyYzqi9P/THhfitSpa6dj5TG2aSBkEN2KGv8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1764251924674755.7181807195667; Thu, 27 Nov 2025 05:58:44 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 993) id 101C844B37; Thu, 27 Nov 2025 08:58:43 -0500 (EST) Received: from [172.19.199.74] (lists.libvirt.org [8.43.85.245]) by lists.libvirt.org (Postfix) with ESMTP id 5E6F4446AC; Thu, 27 Nov 2025 08:54:01 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 993) id 826F8418CA; Thu, 27 Nov 2025 08:52:37 -0500 (EST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (3072 bits) server-digest SHA256) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id F076E44C22 for ; Thu, 27 Nov 2025 08:51:14 -0500 (EST) Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-215-mfgaHG-pN3uVmRoftWLDuQ-1; Thu, 27 Nov 2025 08:51:13 -0500 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 76114180034F for ; Thu, 27 Nov 2025 13:51:12 +0000 (UTC) Received: from moe (unknown [10.43.3.236]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id C127118004A3 for ; Thu, 27 Nov 2025 13:51:11 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-5.0 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_PASS autolearn=unavailable autolearn_force=no version=4.0.1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1764251474; h=from:from: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; bh=Bcn3fbt8ukUAPNr8SqrQtTJydOFjD5pH80YVeMWKCUc=; b=M66BRk6Gvga4adA1KDgsdblDv3qOZamZfsdVfQy4D9AEafLc1oEewUHfbLQEqpt/0qJRkw Z490y0u2zPootgbCrYOrvn1XTbUcspzA7A8AhAuDs6K9NjEAS3DCgs0OlPef65tRWlCy8S b7llLilmzVRLMR12rqhbQWRG+O22C34= X-MC-Unique: mfgaHG-pN3uVmRoftWLDuQ-1 X-Mimecast-MFC-AGG-ID: mfgaHG-pN3uVmRoftWLDuQ_1764251472 To: devel@lists.libvirt.org Subject: [PATCH 5/8] iptablesPrivateChainCreate: Rename @tmp variable Date: Thu, 27 Nov 2025 14:51:00 +0100 Message-ID: <61744133c2be469180dd34f19191f2a5aae704e3.1764251323.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: VZR2RkqNvhSYc9Tu5UtDhi2-uTnI4dK8pxQUCojX2Ts_1764251472 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: IDMEFWOX7ODKNIE7FS4APDWLAV4322XU X-Message-ID-Hash: IDMEFWOX7ODKNIE7FS4APDWLAV4322XU X-MailFrom: mprivozn@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; header-match-devel.lists.libvirt.org-0; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Michal Privoznik via Devel Reply-To: Michal Privoznik X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1764251925634019200 Content-Type: text/plain; charset="utf-8"; x-default="true" From: Michal Privoznik The iptablesPrivateChainCreate() function gets a NULL terminated array of strings (@lines argument), each item representing one line of iptables output. Currently, the variable used to iterate over the array is named 'tmp' which is not very descriptive. Rename it to 'line'. Signed-off-by: Michal Privoznik --- src/network/network_iptables.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/network/network_iptables.c b/src/network/network_iptables.c index e8da15426e..be91b273ed 100644 --- a/src/network/network_iptables.c +++ b/src/network/network_iptables.c @@ -85,26 +85,27 @@ iptablesPrivateChainCreate(virFirewall *fw, iptablesGlobalChainData *data =3D opaque; g_autoptr(GHashTable) chains =3D virHashNew(NULL); g_autoptr(GHashTable) links =3D virHashNew(NULL); - const char *const *tmp; + const char *const *line; size_t i; =20 - tmp =3D lines; - while (tmp && *tmp) { - if (STRPREFIX(*tmp, "-N ")) { /* eg "-N LIBVIRT_INP" */ - if (virHashUpdateEntry(chains, *tmp + 3, (void *)0x1) < 0) + line =3D lines; + while (line && *line) { + if (STRPREFIX(*line, "-N ")) { /* eg "-N LIBVIRT_INP" */ + if (virHashUpdateEntry(chains, *line + 3, (void *)0x1) < 0) return -1; - } else if (STRPREFIX(*tmp, "-A ")) { /* eg "-A INPUT -j LIBVIRT_IN= P" */ - char *sep =3D strchr(*tmp + 3, ' '); + } else if (STRPREFIX(*line, "-A ")) { /* eg "-A INPUT -j LIBVIRT_I= NP" */ + char *sep =3D strchr(*line + 3, ' '); + if (sep) { *sep =3D '\0'; if (STRPREFIX(sep + 1, "-j ")) { if (virHashUpdateEntry(links, sep + 4, - (char *)*tmp + 3) < 0) + (char *)*line + 3) < 0) return -1; } } } - tmp++; + line++; } =20 for (i =3D 0; i < data->nchains; i++) { --=20 2.51.2