From patchwork Wed Mar 9 14:12:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Schantl X-Patchwork-Id: 5324 Return-Path: Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4KDDg61Khtz3xgV for ; Wed, 9 Mar 2022 14:12:50 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail02.haj.ipfire.org", Issuer "R3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4KDDg328CWz1DM; Wed, 9 Mar 2022 14:12:47 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4KDDg31n1gz30H6; Wed, 9 Mar 2022 14:12:47 +0000 (UTC) Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4KDDg00x3sz30H6 for ; Wed, 9 Mar 2022 14:12:44 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by mail01.ipfire.org (Postfix) with ESMTPSA id 4KDDfz5XHFz35k; Wed, 9 Mar 2022 14:12:43 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1646835164; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=4yJghjptfLLWntff1IkUGSo2mlv6ZFbf8dluCWU2AF8=; b=sjvnxBe22c1j8NbAY2czEe5A1BD0melfZQ7ysli8ZqDt4Y11SAAa8miflv7sXT3+kGw4++ ZaGADl4fC8BYZfDQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1646835164; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=4yJghjptfLLWntff1IkUGSo2mlv6ZFbf8dluCWU2AF8=; b=J2hPjphrIQIITNekkUtfRwzVRfytEJa0tV8QITluYsdIbUYYVQgnPzfMaSj8yzauVONkRw 1KuY5O3OcgNlasi2HtqF1D/AquXIx7Ft9Nzde+F5Wib5B1T/kYciDF+cDge3ZuQ04GgFVe Py4UsS2vY0jaEZUyGyGkQfDvXmItbpkp9XRKaVGvMX3AEDoE5BwMxu7bKvzMFLPOy1ynVD /4PTWJS7HpxzbzXfoYouXzMnf+k0rCd4GopLT0FaVuZXcqrt3gdGF65V8IkIp1Tc5yfsOU HASogLXgXyHD6H2NSnTb2AmnVd2Td1IOTnyY7aw+4GmiFTplAGKW7VpDqBbfQg== From: Stefan Schantl To: development@lists.ipfire.org Subject: [PATCH 3/4] rules.pl: Do not create HOSTILE rules if no red dev is available. Date: Wed, 9 Mar 2022 15:12:31 +0100 Message-Id: <20220309141232.2401848-3-stefan.schantl@ipfire.org> In-Reply-To: <20220309141232.2401848-1-stefan.schantl@ipfire.org> References: <20220309141232.2401848-1-stefan.schantl@ipfire.org> MIME-Version: 1.0 X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: IPFire development talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: development-bounces@lists.ipfire.org Sender: "Development" Signed-off-by: Stefan Schantl --- config/firewall/rules.pl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/config/firewall/rules.pl b/config/firewall/rules.pl index 83216e78a..57f4809b4 100644 --- a/config/firewall/rules.pl +++ b/config/firewall/rules.pl @@ -695,6 +695,9 @@ sub drop_hostile_networks () { return; } + # Exit if there is no red interface. + return unless($RED_DEV); + # Call function to load the network list of hostile networks. &ipset_restore($HOSTILE_CCODE);