GNU bug report logs - #67017
[PATCH] gnu: Add iptables-nft.

Previous Next

Package: guix-patches;

Reported by: Hilton Chain <hako <at> ultrarare.space>

Date: Thu, 9 Nov 2023 14:40:01 UTC

Severity: normal

Tags: patch

Done: Hilton Chain <hako <at> ultrarare.space>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 67017 in the body.
You can then email your comments to 67017 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to leo <at> famulari.name, me <at> tobias.gr, guix-patches <at> gnu.org:
bug#67017; Package guix-patches. (Thu, 09 Nov 2023 14:40:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Hilton Chain <hako <at> ultrarare.space>:
New bug report received and forwarded. Copy sent to leo <at> famulari.name, me <at> tobias.gr, guix-patches <at> gnu.org. (Thu, 09 Nov 2023 14:40:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Hilton Chain <hako <at> ultrarare.space>
To: guix-patches <at> gnu.org
Cc: Hilton Chain <hako <at> ultrarare.space>
Subject: [PATCH] gnu: Add iptables-nft.
Date: Thu,  9 Nov 2023 22:36:44 +0800
* gnu/packages/linux.scm (iptables-nft): New variable.

Change-Id: I281514fcf05e70b4d62f374269c50c76bb676f78
---
 gnu/packages/linux.scm | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index 95a66e3d6a..596019ae5b 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -3101,6 +3101,33 @@ (define-public iptables
      '((release-monitoring-url . "https://www.netfilter.org/pub/iptables/")))
     (license license:gpl2+)))
 
+(define-public iptables-nft
+  (package/inherit iptables
+    (name "iptables-nft")
+    (arguments
+     (substitute-keyword-arguments (package-arguments iptables)
+       ((#:phases phases '%standard-phases)
+        #~(modify-phases #$phases
+            (add-after 'install 'symlink-xtables-nft-multi
+              (lambda _
+                (for-each
+                 (lambda (command-path)
+                   (let ((link-path (string-append #$output command-path)))
+                     (when (file-exists? link-path)
+                       (delete-file link-path))
+                     (symlink (string-append #$output "/sbin/xtables-nft-multi")
+                              link-path)))
+                 (apply append
+                        '("/bin/iptables-xml")
+                        (map (lambda (xtables)
+                               (list (string-append "/sbin/" xtables)
+                                     (string-append "/sbin/" xtables "-restore")
+                                     (string-append "/sbin/" xtables "-save")))
+                             '("arptables"
+                               "ebtables"
+                               "iptables"
+                               "ip6tables"))))))))))))
+
 (define-public bolt
   (package
     (name "bolt")

base-commit: 960d7ac5a56155895543e03622f6555cc162d13a
-- 
2.41.0





Information forwarded to hako <at> ultrarare.space, leo <at> famulari.name, me <at> tobias.gr, guix-patches <at> gnu.org:
bug#67017; Package guix-patches. (Sun, 12 Nov 2023 15:31:02 GMT) Full text and rfc822 format available.

Message #8 received at 67017 <at> debbugs.gnu.org (full text, mbox):

From: Hilton Chain <hako <at> ultrarare.space>
To: 67017 <at> debbugs.gnu.org
Cc: Hilton Chain <hako <at> ultrarare.space>
Subject: [PATCH v2] gnu: Add iptables-nft.
Date: Sun, 12 Nov 2023 23:28:19 +0800
* gnu/packages/linux.scm (iptables-nft): New variable.

Change-Id: I281514fcf05e70b4d62f374269c50c76bb676f78
---

V1 -> V2:
Add iptables to inputs and switch to copy-build-system, since there's no need to
build it again.

 gnu/packages/linux.scm | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index 95a66e3d6a..397fc911ea 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -3101,6 +3101,38 @@ (define-public iptables
      '((release-monitoring-url . "https://www.netfilter.org/pub/iptables/")))
     (license license:gpl2+)))
 
+(define-public iptables-nft
+  (package
+    (inherit iptables)
+    (name "iptables-nft")
+    (source #f)
+    (build-system copy-build-system)
+    (arguments
+     (list
+      #:phases
+      #~(modify-phases %standard-phases
+          (delete 'unpack)
+          (replace 'install
+            (lambda* (#:key inputs #:allow-other-keys)
+              (for-each
+               (lambda (command-path)
+                 (let ((link-path (string-append #$output command-path)))
+                   (mkdir-p (dirname link-path))
+                   (symlink (search-input-file inputs "sbin/xtables-nft-multi")
+                            link-path)))
+               (apply append
+                      '("/bin/iptables-xml")
+                      (map (lambda (xtables)
+                             (list (string-append "/sbin/" xtables)
+                                   (string-append "/sbin/" xtables "-restore")
+                                   (string-append "/sbin/" xtables "-save")))
+                           '("arptables"
+                             "ebtables"
+                             "iptables"
+                             "ip6tables")))))))))
+    (inputs (list iptables))
+    (native-inputs '())))
+
 (define-public bolt
   (package
     (name "bolt")

base-commit: e35b7c5386c1bfacf47ed31bac9b503373dd26fc
-- 
2.41.0





Information forwarded to guix-patches <at> gnu.org:
bug#67017; Package guix-patches. (Sun, 26 Nov 2023 22:35:02 GMT) Full text and rfc822 format available.

Message #11 received at 67017 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Hilton Chain <hako <at> ultrarare.space>
Cc: Tobias Geerinckx-Rice <me <at> tobias.gr>, 67017 <at> debbugs.gnu.org,
 Leo Famulari <leo <at> famulari.name>
Subject: Re: [bug#67017] [PATCH v2] gnu: Add iptables-nft.
Date: Sun, 26 Nov 2023 23:34:22 +0100
Hi,

Hilton Chain <hako <at> ultrarare.space> skribis:

> * gnu/packages/linux.scm (iptables-nft): New variable.
>
> Change-Id: I281514fcf05e70b4d62f374269c50c76bb676f78

[...]

> +(define-public iptables-nft
> +  (package
> +    (inherit iptables)
> +    (name "iptables-nft")
> +    (source #f)
> +    (build-system copy-build-system)
> +    (arguments
> +     (list
> +      #:phases
> +      #~(modify-phases %standard-phases
> +          (delete 'unpack)
> +          (replace 'install
> +            (lambda* (#:key inputs #:allow-other-keys)
> +              (for-each
> +               (lambda (command-path)
> +                 (let ((link-path (string-append #$output command-path)))
> +                   (mkdir-p (dirname link-path))
> +                   (symlink (search-input-file inputs "sbin/xtables-nft-multi")
> +                            link-path)))
> +               (apply append
> +                      '("/bin/iptables-xml")
> +                      (map (lambda (xtables)
> +                             (list (string-append "/sbin/" xtables)
> +                                   (string-append "/sbin/" xtables "-restore")
> +                                   (string-append "/sbin/" xtables "-save")))
> +                           '("arptables"
> +                             "ebtables"
> +                             "iptables"
> +                             "ip6tables")))))))))
> +    (inputs (list iptables))
> +    (native-inputs '())))

I think we at least need ‘synopsis’ to clarify what this is about
compared to ‘iptables’.

Apart from that it LGTM, thanks!

Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#67017; Package guix-patches. (Sat, 09 Dec 2023 12:39:02 GMT) Full text and rfc822 format available.

Message #14 received at 67017 <at> debbugs.gnu.org (full text, mbox):

From: Hilton Chain <hako <at> ultrarare.space>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: Tobias Geerinckx-Rice <me <at> tobias.gr>, 67017 <at> debbugs.gnu.org,
 Leo Famulari <leo <at> famulari.name>
Subject: Re: [bug#67017] [PATCH v2] gnu: Add iptables-nft.
Date: Sat, 09 Dec 2023 20:32:18 +0800
Hi,
On Mon, 27 Nov 2023 06:34:22 +0800,
Ludovic Courtès wrote:
>
[...]
> I think we at least need ‘synopsis’ to clarify what this is about
> compared to ‘iptables’.

Does it look good to append a "(nftables API)" to the synopsis of
iptables?  So that it says "Programs to configure Linux IP packet
filtering rules (nftables API)".

Reply sent to Hilton Chain <hako <at> ultrarare.space>:
You have taken responsibility. (Tue, 19 Dec 2023 14:03:01 GMT) Full text and rfc822 format available.

Notification sent to Hilton Chain <hako <at> ultrarare.space>:
bug acknowledged by developer. (Tue, 19 Dec 2023 14:03:02 GMT) Full text and rfc822 format available.

Message #19 received at 67017-done <at> debbugs.gnu.org (full text, mbox):

From: Hilton Chain <hako <at> ultrarare.space>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: Tobias Geerinckx-Rice <me <at> tobias.gr>, 67017-done <at> debbugs.gnu.org,
 Leo Famulari <leo <at> famulari.name>
Subject: Close: [bug#67017] [PATCH v2] gnu: Add iptables-nft.
Date: Tue, 19 Dec 2023 21:52:41 +0800
On Sat, 09 Dec 2023 20:32:18 +0800,
Hilton Chain wrote:
>
> Hi,
> On Mon, 27 Nov 2023 06:34:22 +0800,
> Ludovic Courtès wrote:
> >
> [...]
> > I think we at least need ‘synopsis’ to clarify what this is about
> > compared to ‘iptables’.
>
> Does it look good to append a "(nftables API)" to the synopsis of
> iptables?  So that it says "Programs to configure Linux IP packet
> filtering rules (nftables API)".

I used this for synopsis and applied the patch as
6884770464bd9ba95c1a5ccf10bf50d186a220d5.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 17 Jan 2024 12:24:07 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 113 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.