From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id OO/xMXSv7GBIhwAAgWs5BA (envelope-from ) for ; Mon, 12 Jul 2021 23:09:08 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id sD+mLXSv7GDxBwAA1q6Kng (envelope-from ) for ; Mon, 12 Jul 2021 21:09:08 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 82B7D192D1 for ; Mon, 12 Jul 2021 23:09:08 +0200 (CEST) Received: from localhost ([::1]:38010 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m33Ap-00087x-Lw for larch@yhetil.org; Mon, 12 Jul 2021 17:09:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43528) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m33Ak-00087S-JL for guix-patches@gnu.org; Mon, 12 Jul 2021 17:09:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:55654) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m33Ak-0006L2-Bs for guix-patches@gnu.org; Mon, 12 Jul 2021 17:09:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1m33Ak-00021l-8B for guix-patches@gnu.org; Mon, 12 Jul 2021 17:09:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#49540] [PATCH 1/2] services: nftables: Only manage delete our own table. Resent-From: Brice Waegeneire Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 12 Jul 2021 21:09:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49540 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 49540@debbugs.gnu.org Cc: iyzsong@member.fsf.org, solene@perso.pw X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.16261241187756 (code B ref -1); Mon, 12 Jul 2021 21:09:02 +0000 Received: (at submit) by debbugs.gnu.org; 12 Jul 2021 21:08:38 +0000 Received: from localhost ([127.0.0.1]:38965 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m33AI-00020w-3J for submit@debbugs.gnu.org; Mon, 12 Jul 2021 17:08:38 -0400 Received: from lists.gnu.org ([209.51.188.17]:53668) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m33AF-00020i-Fp for submit@debbugs.gnu.org; Mon, 12 Jul 2021 17:08:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43450) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m33AF-00083S-As for guix-patches@gnu.org; Mon, 12 Jul 2021 17:08:31 -0400 Received: from relay10.mail.gandi.net ([217.70.178.230]:33731) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m33AD-0005xc-I2 for guix-patches@gnu.org; Mon, 12 Jul 2021 17:08:31 -0400 Received: (Authenticated sender: brice@waegenei.re) by relay10.mail.gandi.net (Postfix) with ESMTPSA id C841F240003; Mon, 12 Jul 2021 21:08:26 +0000 (UTC) From: Brice Waegeneire Date: Mon, 12 Jul 2021 23:08:22 +0200 Message-Id: <20210712210823.16987-1-brice@waegenei.re> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210712210543.16598-1-brice@waegenei.re> References: <20210712210543.16598-1-brice@waegenei.re> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=217.70.178.230; envelope-from=brice@waegenei.re; helo=relay10.mail.gandi.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1626124148; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post; bh=80e9I2ZUV+cE+bmZ1ckjtN2jZXkQoAPVMl/ptWU/IlQ=; b=TgmzMc5clhZodJUuodekeZeKoJ3lMtjA4CHaHEzdCVlYmvjxSOyZ5SpqLWYp15SNjU7yUq ni6Jm6rje1mlb8ItEpw0Ew9reKBXBp0l4ZU4EUA++33b8SzswUdDuB5YZA21fKyLZRIvsF NvfndWeecRbl+tanCxoweUQN2noehbX53TGZZsWer8UlCNLJq10Oefw4A5xIqPEHdjZMM0 wc/lvXiLDEpsFHClRu6uF2kOpi7xJcVsxxbGousyGcxnyWSPijY6oBhWonLkByQSv09v5R 2Tb6VOtQaNxZZ7K3DxrAROv84I6k+Cs+rSq7WrL48mUluwugwPqOcTowKwx1yg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1626124148; a=rsa-sha256; cv=none; b=dSfKRYn/3dHEHSOkyGAE5DXFN6+PcUVSZ0oN1CfqJ5QooRbiSshy2Q5wpzDO1n+0P67sbj k44jT7bvcKwYdWA/dfMLlV3AXQ1mD1rTdffQBqYP+lrioOFapGIjufTgm296VHyS9Fkcti rJd5xumY6MG9A/MvpRUaJWNPQENzn59wCrPFPf1ETxQLwPeOu0uUqoA0sptMd6RJDUKllw I/QBPJ6gMtoVdz6jAmueATbzSrCOWqJ9qxvwe9XsYIAM6FNqbUqHMpBxZ9UG2PW/c7+d86 +O3qM9bY45Vl54zY56gRCGtP1vH7Emkb91+L6L93E84cECjlq1MzC/a1c2yYug== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Spam-Score: -1.40 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: 82B7D192D1 X-Spam-Score: -1.40 X-Migadu-Scanner: scn0.migadu.com X-TUID: U6FFCV5xLeAl * gnu/services/networking.scm (%default-nftables-ruleset): Rename table from "forward" to "guix". Clear table before applying before setting it up. (nftables-shepherd-service): Don't flush all the table, just delete our own. --- gnu/services/networking.scm | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/gnu/services/networking.scm b/gnu/services/networking.scm index 1ae58041d3..3058c14caf 100644 --- a/gnu/services/networking.scm +++ b/gnu/services/networking.scm @@ -13,7 +13,7 @@ ;;; Copyright © 2019, 2021 Maxim Cournoyer ;;; Copyright © 2019 Sou Bunnbu ;;; Copyright © 2019 Alex Griffin -;;; Copyright © 2020 Brice Waegeneire +;;; Copyright © 2020, 2021 Brice Waegeneire ;;; Copyright © 2021 Oleg Pykhalov ;;; Copyright © 2021 Christopher Lemmer Webber ;;; Copyright © 2021 Maxime Devos @@ -1717,7 +1717,12 @@ COMMIT (define %default-nftables-ruleset (plain-file "nftables.conf" "# A simple and safe firewall -table inet filter { + +# Start with our table clean of previous state +add table inet guix +delete table inet guix + +table inet guix { chain input { type filter hook input priority 0; policy drop; @@ -1768,7 +1773,7 @@ table inet filter { (start #~(lambda _ (invoke #$nft "--file" #$ruleset))) (stop #~(lambda _ - (invoke #$nft "flush" "ruleset")))))))) + (invoke #$nft "delete" "table" "inet" "guix")))))))) (define nftables-service-type (service-type -- 2.31.1