From patchwork Mon Oct 18 10:10:22 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Tremer X-Patchwork-Id: 4797 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 4HXtB72Q7nz3wcr for ; Mon, 18 Oct 2021 10:18:23 +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 4HXt9q6GHrz5TS; Mon, 18 Oct 2021 10:18:07 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4HXt9p4phdz31ry; Mon, 18 Oct 2021 10:18:06 +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 4HXt9n4kcMz2yC8 for ; Mon, 18 Oct 2021 10:18:05 +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 4HXt9n2fTZz27r; Mon, 18 Oct 2021 10:18:05 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1634552285; 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=ks5Ff9wYO1Z6v/HBynVNVFejvxWth0kKrfB0dVxcHBA=; b=jHNp/vMOR4pTBW4hPhaEpSwhE6idCscGU9LaHjlX5XpMCWlXFIfIl6b8vSXXNhLZ2hJicu p2Podfq8uQxUIqAw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1634552285; 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=ks5Ff9wYO1Z6v/HBynVNVFejvxWth0kKrfB0dVxcHBA=; b=ASLNf9UWUaOzSe7a1M0YSnaERn/Mcyv6uj3QmnSuZTwnjh9yOakTOVO5bogHgsc1FsS19d k7Qe8VY7lkbUZKOryQFwEM+ixU8RMgPXGi3zCZLb6C5lFfrAMvC/48mhNCboSiEhmP3ijV uQUxBX/XnAL7UD9zlqsTZn2SDo08xQN5109kS5aT4Uh5O5JhtwSPOtGBnfkuvKWi6Ylok5 MTxoKyI0Xwu4v50Ou9Y/EcFOnw27vp7TuV7r7rG0HNpLoa4dWBzTwE1Cmh8awI0IjX/u62 2kAx8dgleZx72rHY16BHuZ6vJmfiQQ7S1oLgJBJRNDZ3jywxRqgZvdjx9MdTwA== From: Michael Tremer To: development@lists.ipfire.org Subject: [PATCH 9/9] firewall: Keep REPEAT bit when saving rest to CONNMARK Date: Mon, 18 Oct 2021 10:10:22 +0000 Message-Id: <20211018101022.15448-9-michael.tremer@ipfire.org> In-Reply-To: <20211018101022.15448-1-michael.tremer@ipfire.org> References: <20211018101022.15448-1-michael.tremer@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: , Cc: Michael Tremer Errors-To: development-bounces@lists.ipfire.org Sender: "Development" Signed-off-by: Michael Tremer Tested-by: Stefan Schantl --- src/initscripts/system/firewall | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/initscripts/system/firewall b/src/initscripts/system/firewall index 530e8f1d6..5fc63683c 100644 --- a/src/initscripts/system/firewall +++ b/src/initscripts/system/firewall @@ -48,8 +48,7 @@ iptables_init() { # IPS Bypass Chain which stores the BYPASS bit in connection tracking iptables -N IPSBYPASS - iptables -A IPSBYPASS -j MARK --set-xmark "0/$(( IPS_REPEAT_MASK ))" - iptables -A IPSBYPASS -j CONNMARK --save-mark + iptables -A IPSBYPASS -j CONNMARK --save-mark --mask "$(( ~IPS_REPEAT_MASK & 0xffffffff ))" # Jump into bypass chain when the BYPASS bit is set for chain in INPUT FORWARD OUTPUT; do