Date: Friday, January 27, 2023 @ 18:46:08
Author: felixonmars
Revision: 467452
archrelease: copy trunk to testing-x86_64
Added:
iptables/repos/testing-x86_64/
iptables/repos/testing-x86_64/PKGBUILD
(from rev 467451, iptables/trunk/PKGBUILD)
iptables/repos/testing-x86_64/arptables.service
(from rev 467451, iptables/trunk/arptables.service)
iptables/repos/testing-x86_64/ebtables.service
(from rev 467451, iptables/trunk/ebtables.service)
iptables/repos/testing-x86_64/empty-filter.rules
(from rev 467451, iptables/trunk/empty-filter.rules)
iptables/repos/testing-x86_64/empty-mangle.rules
(from rev 467451, iptables/trunk/empty-mangle.rules)
iptables/repos/testing-x86_64/empty-nat.rules
(from rev 467451, iptables/trunk/empty-nat.rules)
iptables/repos/testing-x86_64/empty-raw.rules
(from rev 467451, iptables/trunk/empty-raw.rules)
iptables/repos/testing-x86_64/empty-security.rules
(from rev 467451, iptables/trunk/empty-security.rules)
iptables/repos/testing-x86_64/empty.rules
(from rev 467451, iptables/trunk/empty.rules)
iptables/repos/testing-x86_64/ip6tables.service
(from rev 467451, iptables/trunk/ip6tables.service)
iptables/repos/testing-x86_64/iptables-apply-default-path.patch
(from rev 467451, iptables/trunk/iptables-apply-default-path.patch)
iptables/repos/testing-x86_64/iptables-legacy-flush
(from rev 467451, iptables/trunk/iptables-legacy-flush)
iptables/repos/testing-x86_64/iptables-nft-flush
(from rev 467451, iptables/trunk/iptables-nft-flush)
iptables/repos/testing-x86_64/iptables.service
(from rev 467451, iptables/trunk/iptables.service)
iptables/repos/testing-x86_64/keys/
iptables/repos/testing-x86_64/simple_firewall.rules
(from rev 467451, iptables/trunk/simple_firewall.rules)
-----------------------------------+
PKGBUILD | 108 ++++++++++++++++++++++++++++++++++++
arptables.service | 14 ++++
ebtables.service | 14 ++++
empty-filter.rules | 6 ++
empty-mangle.rules | 8 ++
empty-nat.rules | 7 ++
empty-raw.rules | 5 +
empty-security.rules | 6 ++
empty.rules | 6 ++
ip6tables.service | 15 +++++
iptables-apply-default-path.patch | 53 +++++++++++++++++
iptables-legacy-flush | 18 ++++++
iptables-nft-flush | 18 ++++++
iptables.service | 14 ++++
simple_firewall.rules | 11 +++
15 files changed, 303 insertions(+)
Copied: iptables/repos/testing-x86_64/PKGBUILD (from rev 467451,
iptables/trunk/PKGBUILD)
===================================================================
--- testing-x86_64/PKGBUILD (rev 0)
+++ testing-x86_64/PKGBUILD 2023-01-27 18:46:08 UTC (rev 467452)
@@ -0,0 +1,108 @@
+# Maintainer: Ronald van Haren <ronald.archlinux.org>
+# Contributor: Thomas Baechler <[email protected]>
+
+pkgbase=iptables
+pkgname=(iptables iptables-nft)
+pkgver=1.8.9
+pkgrel=1
+epoch=1
+pkgdesc='Linux kernel packet control tool'
+arch=(x86_64)
+license=(GPL2)
+url='https://www.netfilter.org/projects/iptables/index.html'
+depends=(libnftnl libpcap libnfnetlink libnetfilter_conntrack bash)
+makedepends=(linux-api-headers)
+backup=(etc/ethertypes etc/iptables/{ip,ip6}tables.rules)
+source=(https://www.netfilter.org/projects/iptables/files/$pkgbase-$pkgver.tar.xz{,.sig}
+ empty.rules simple_firewall.rules
empty-{filter,mangle,nat,raw,security}.rules
+ {arp,eb,ip,ip6}tables.service iptables-{legacy,nft}-flush
+
iptables-format-security-libxt_NAT.patch::https://git.netfilter.org/iptables/patch/?id=ed4082a7405a5838c205a34c1559e289949200cc
+ iptables-apply-default-path.patch)
+sha256sums=('ef6639a43be8325a4f8ea68123ffac236cb696e8c78501b64e8106afb008c87f'
+ 'SKIP'
+ '630d774f089703c2c7370db6d7c188dae25d00c26feaa3d3de8eb52519033948'
+ '9e83d7ae39d31881790f814930d44acbaeab1520adb2fb4fcb80f0bbfab174b9'
+ '09b90da35c2c8cb0fbda63b300f06d2387a102ca53a40980ef0b49829e249528'
+ '92755648f456e235d17a8faeb5f46d27af66eb4db10ea4bac0abd3e35e2dae07'
+ '52bd70dff3e1e1a64127ad7ed86840834b79756c3bdb6947b7c6279ffe95dd48'
+ '5768a471c0559848635c39d270e456bfa5c43eda65f5f6f666fea2d277183a37'
+ '91161a73f323016a9efc5eabd16243d20f8ca2467995cf0eabfb95f845090121'
+ 'dd1a867085900eec1f1d4e12f97a1f44707c717246f6787ed42d4225343920d6'
+ '82e09b4151d5c1dd0fc212189c670f8f29e8ec85e7e9cdc57f49dcea00d7e9ca'
+ '78f090812b5bb9aec597ce2cf757da1c58ec772c60bf55f10267f06459aefd9b'
+ 'c37c69db5077a061fd72fc3b199712f1bed8688de8008f219223fadd6fa6c06f'
+ '40680b3c877926a2bac698ea58f52d1d4b3ab152ee68ccd7fa7ca51aeedc3b2d'
+ '6d3e7bdeebdaeaf83ed448f4d42a979c8c59fb5e919f6f860ed340c2c9afef1a'
+ '3784e61958cf96a8e5e04df885defadf1cd70caa1e9d6c6f144bdbc64441eabe'
+ '770ceaedce26d05eb1b9d0c4c65f5b8e92facd1dc0652a29c859336d6bc347f6')
+validpgpkeys=('C09DB2063F1D7034BA6152ADAB4655A126D292E4'
+ '37D964ACC04981C75500FB9BD55D978A8A1420E4') # Netfilter Core Team
+
+prepare() {
+ mkdir build
+ cd $pkgbase-$pkgver
+
+ # use system one
+ rm include/linux/types.h
+
+ ln -rs libiptc/linux_list.h include/libiptc
+ patch -p1 -i ../iptables-format-security-libxt_NAT.patch # Fix build with
-Werror=format-security
+
+ # use Arch path
+ patch -p0 -i ../iptables-apply-default-path.patch
+}
+
+build() {
+ cd build
+ ../$pkgbase-$pkgver/configure \
+ --prefix=/usr \
+ --sysconfdir=/etc \
+ --sbindir=/usr/bin \
+ --libexecdir=/usr/lib \
+ --enable-bpf-compiler \
+ --enable-devel \
+ --enable-libipq \
+ --enable-shared
+ sed -e 's/ -shared / -Wl,-O1,--as-needed\0/g' -i libtool
+ make
+}
+
+package_iptables() {
+ pkgdesc+=' (using legacy interface)'
+ _package legacy
+}
+
+package_iptables-nft() {
+ pkgdesc+=' (using nft interface)'
+ depends+=(nftables)
+ provides=(iptables arptables ebtables)
+ conflicts=(iptables arptables ebtables)
+ backup+=(etc/{arp,eb}tables.conf)
+
+ _package nft
+
+ install -Dt "$pkgdir/usr/lib/systemd/system" -m644 {arp,eb}tables.service
+ touch "$pkgdir"/etc/{arp,eb}tables.conf
+}
+
+_package() {
+ DESTDIR="$pkgdir" make -C build install
+
+ for _x in {arp,eb,ip,ip6}tables{,-restore,-save} iptables-xml; do
+ if [[ $1 = nft || $_x = ip* ]]; then
+ ln -sf xtables-$1-multi "$pkgdir/usr/bin/$_x"
+ else
+ rm "$pkgdir/usr/bin/$_x"
+ fi
+ done
+
+ install -Dt "$pkgdir/usr/lib/systemd/system" -m644 {ip,ip6}tables.service
+ install -D iptables-$1-flush "$pkgdir/usr/lib/systemd/scripts/iptables-flush"
+
+ install -Dm644 empty.rules "$pkgdir/etc/iptables/iptables.rules"
+ install -Dm644 empty.rules "$pkgdir/etc/iptables/ip6tables.rules"
+ install -Dt "$pkgdir/usr/share/iptables" -m644 *.rules
+ ln -srt "$pkgdir/etc/iptables"
"$pkgdir"/usr/share/iptables/{empty,simple_firewall}.rules
+}
+
+# vim:set sw=2 et:
Copied: iptables/repos/testing-x86_64/arptables.service (from rev 467451,
iptables/trunk/arptables.service)
===================================================================
--- testing-x86_64/arptables.service (rev 0)
+++ testing-x86_64/arptables.service 2023-01-27 18:46:08 UTC (rev 467452)
@@ -0,0 +1,14 @@
+[Unit]
+Description=ARP table
+Before=network-pre.target
+Wants=network-pre.target
+
+[Service]
+Type=oneshot
+ExecStart=/bin/sh -c 'arptables-restore < /etc/arptables.conf'
+ExecReload=/bin/sh -c 'arptables-restore < /etc/arptables.conf'
+ExecStop=/bin/sh -c 'arptables-restore < /dev/null'
+RemainAfterExit=yes
+
+[Install]
+WantedBy=multi-user.target
Copied: iptables/repos/testing-x86_64/ebtables.service (from rev 467451,
iptables/trunk/ebtables.service)
===================================================================
--- testing-x86_64/ebtables.service (rev 0)
+++ testing-x86_64/ebtables.service 2023-01-27 18:46:08 UTC (rev 467452)
@@ -0,0 +1,14 @@
+[Unit]
+Description=Ethernet bridge table
+Before=network-pre.target
+Wants=network-pre.target
+
+[Service]
+Type=oneshot
+ExecStart=/bin/sh -c 'ebtables-restore < /etc/ebtables.conf'
+ExecReload=/bin/sh -c 'ebtables-restore < /etc/ebtables.conf'
+ExecStop=/bin/sh -c 'ebtables-restore < /dev/null'
+RemainAfterExit=yes
+
+[Install]
+WantedBy=multi-user.target
Copied: iptables/repos/testing-x86_64/empty-filter.rules (from rev 467451,
iptables/trunk/empty-filter.rules)
===================================================================
--- testing-x86_64/empty-filter.rules (rev 0)
+++ testing-x86_64/empty-filter.rules 2023-01-27 18:46:08 UTC (rev 467452)
@@ -0,0 +1,6 @@
+# Empty iptables filter table rule file
+*filter
+:INPUT ACCEPT [0:0]
+:FORWARD ACCEPT [0:0]
+:OUTPUT ACCEPT [0:0]
+COMMIT
Copied: iptables/repos/testing-x86_64/empty-mangle.rules (from rev 467451,
iptables/trunk/empty-mangle.rules)
===================================================================
--- testing-x86_64/empty-mangle.rules (rev 0)
+++ testing-x86_64/empty-mangle.rules 2023-01-27 18:46:08 UTC (rev 467452)
@@ -0,0 +1,8 @@
+# Empty iptables mangle table rules file
+*mangle
+:PREROUTING ACCEPT [0:0]
+:INPUT ACCEPT [0:0]
+:FORWARD ACCEPT [0:0]
+:OUTPUT ACCEPT [0:0]
+:POSTROUTING ACCEPT [0:0]
+COMMIT
Copied: iptables/repos/testing-x86_64/empty-nat.rules (from rev 467451,
iptables/trunk/empty-nat.rules)
===================================================================
--- testing-x86_64/empty-nat.rules (rev 0)
+++ testing-x86_64/empty-nat.rules 2023-01-27 18:46:08 UTC (rev 467452)
@@ -0,0 +1,7 @@
+# Empty iptables nat table rules file
+*nat
+:PREROUTING ACCEPT [0:0]
+:INPUT ACCEPT [0:0]
+:OUTPUT ACCEPT [0:0]
+:POSTROUTING ACCEPT [0:0]
+COMMIT
Copied: iptables/repos/testing-x86_64/empty-raw.rules (from rev 467451,
iptables/trunk/empty-raw.rules)
===================================================================
--- testing-x86_64/empty-raw.rules (rev 0)
+++ testing-x86_64/empty-raw.rules 2023-01-27 18:46:08 UTC (rev 467452)
@@ -0,0 +1,5 @@
+# Empty iptables raw table rules file
+*raw
+:PREROUTING ACCEPT [0:0]
+:OUTPUT ACCEPT [0:0]
+COMMIT
Copied: iptables/repos/testing-x86_64/empty-security.rules (from rev 467451,
iptables/trunk/empty-security.rules)
===================================================================
--- testing-x86_64/empty-security.rules (rev 0)
+++ testing-x86_64/empty-security.rules 2023-01-27 18:46:08 UTC (rev 467452)
@@ -0,0 +1,6 @@
+# Empty iptables security table rules file
+*security
+:INPUT ACCEPT [0:0]
+:FORWARD ACCEPT [0:0]
+:OUTPUT ACCEPT [0:0]
+COMMIT
Copied: iptables/repos/testing-x86_64/empty.rules (from rev 467451,
iptables/trunk/empty.rules)
===================================================================
--- testing-x86_64/empty.rules (rev 0)
+++ testing-x86_64/empty.rules 2023-01-27 18:46:08 UTC (rev 467452)
@@ -0,0 +1,6 @@
+# Empty iptables rule file
+*filter
+:INPUT ACCEPT [0:0]
+:FORWARD ACCEPT [0:0]
+:OUTPUT ACCEPT [0:0]
+COMMIT
Copied: iptables/repos/testing-x86_64/ip6tables.service (from rev 467451,
iptables/trunk/ip6tables.service)
===================================================================
--- testing-x86_64/ip6tables.service (rev 0)
+++ testing-x86_64/ip6tables.service 2023-01-27 18:46:08 UTC (rev 467452)
@@ -0,0 +1,15 @@
+[Unit]
+Description=IPv6 Packet Filtering Framework
+Before=network-pre.target
+Wants=network-pre.target
+After=iptables.service
+
+[Service]
+Type=oneshot
+ExecStart=/usr/bin/ip6tables-restore /etc/iptables/ip6tables.rules
+ExecReload=/usr/bin/ip6tables-restore /etc/iptables/ip6tables.rules
+ExecStop=/usr/lib/systemd/scripts/iptables-flush 6
+RemainAfterExit=yes
+
+[Install]
+WantedBy=multi-user.target
Copied: iptables/repos/testing-x86_64/iptables-apply-default-path.patch (from
rev 467451, iptables/trunk/iptables-apply-default-path.patch)
===================================================================
--- testing-x86_64/iptables-apply-default-path.patch
(rev 0)
+++ testing-x86_64/iptables-apply-default-path.patch 2023-01-27 18:46:08 UTC
(rev 467452)
@@ -0,0 +1,53 @@
+--- iptables/iptables-apply.8.in.orig 2022-07-25 17:12:06.833791345 +0300
++++ iptables/iptables-apply.8.in 2022-07-25 17:13:35.780742653 +0300
+@@ -21,11 +21,11 @@
+ Successfully applied rules can also be written to savefile and later used
+ to roll back to this state. This can be used to implement a store last good
+ configuration mechanism when experimenting with an iptables setup script:
+-iptables-apply \-w /etc/network/iptables.up.rules \-c
/etc/network/iptables.up.run
++iptables-apply \-w /etc/iptables/iptables.rules \-c /etc/iptables/iptables.run
+ .PP
+ When called as ip6tables\-apply, the script will use
+ ip6tables\-save/\-restore and IPv6 default values instead. Default
+-value for rulesfile is '/etc/network/iptables.up.rules'.
++value for rulesfile is '/etc/iptables/iptables.rules'.
+ .SH OPTIONS
+ .TP
+ \fB\-t\fP \fIseconds\fR, \fB\-\-timeout\fP \fIseconds\fR
+@@ -34,11 +34,11 @@
+ .TP
+ \fB\-w\fP \fIsavefile\fR, \fB\-\-write\fP \fIsavefile\fR
+ Specify the savefile where successfully applied rules will be written to
+-(default if empty string is given: /etc/network/iptables.up.rules).
++(default if empty string is given: /etc/iptables/iptables.rules).
+ .TP
+ \fB\-c\fP \fIruncmd\fR, \fB\-\-command\fP \fIruncmd\fR
+ Run command runcmd to configure iptables instead of applying a rulesfile
+-(default: /etc/network/iptables.up.run).
++(default: /etc/iptables/iptables.run).
+ .TP
+ \fB\-h\fP, \fB\-\-help\fP
+ Display usage information.
+--- iptables/iptables-apply.orig 2022-07-25 17:12:11.713806961 +0300
++++ iptables/iptables-apply 2022-07-25 17:12:34.573880116 +0300
+@@ -31,16 +31,16 @@
+ (*6*)
+ SAVE=ip6tables-save
+ RESTORE=ip6tables-restore
+- DEF_RULESFILE="/etc/network/ip6tables.up.rules"
++ DEF_RULESFILE="/etc/iptables/ip6tables.rules"
+ DEF_SAVEFILE="$DEF_RULESFILE"
+- DEF_RUNCMD="/etc/network/ip6tables.up.run"
++ DEF_RUNCMD="/etc/iptables/ip6tables.run"
+ ;;
+ (*)
+ SAVE=iptables-save
+ RESTORE=iptables-restore
+- DEF_RULESFILE="/etc/network/iptables.up.rules"
++ DEF_RULESFILE="/etc/iptables/iptables.rules"
+ DEF_SAVEFILE="$DEF_RULESFILE"
+- DEF_RUNCMD="/etc/network/iptables.up.run"
++ DEF_RUNCMD="/etc/iptables/iptables.run"
+ ;;
+ esac
+
Copied: iptables/repos/testing-x86_64/iptables-legacy-flush (from rev 467451,
iptables/trunk/iptables-legacy-flush)
===================================================================
--- testing-x86_64/iptables-legacy-flush (rev 0)
+++ testing-x86_64/iptables-legacy-flush 2023-01-27 18:46:08 UTC (rev
467452)
@@ -0,0 +1,18 @@
+#!/bin/bash
+#
+# Usage: iptables-flush [6]
+#
+
+iptables=ip$1tables
+if ! type -p "$iptables" &>/dev/null; then
+ echo "error: invalid argument"
+ exit 1
+fi
+
+while read -r table; do
+ tables+=("/usr/share/iptables/empty-$table.rules")
+done <"/proc/net/ip$1_tables_names"
+
+if (( ${#tables[*]} )); then
+ cat "${tables[@]}" | "$iptables-restore"
+fi
Copied: iptables/repos/testing-x86_64/iptables-nft-flush (from rev 467451,
iptables/trunk/iptables-nft-flush)
===================================================================
--- testing-x86_64/iptables-nft-flush (rev 0)
+++ testing-x86_64/iptables-nft-flush 2023-01-27 18:46:08 UTC (rev 467452)
@@ -0,0 +1,18 @@
+#!/bin/bash
+#
+# Usage: iptables-flush [6]
+#
+
+iptables=ip$1tables
+if ! type -p "$iptables" &>/dev/null; then
+ echo "error: invalid argument"
+ exit 1
+fi
+
+while read -r table; do
+ tables+=("/usr/share/iptables/empty-$table.rules")
+done < <(nft list tables | sed -n "s/table ip$1 //p")
+
+if (( ${#tables[*]} )); then
+ cat "${tables[@]}" | "$iptables-restore"
+fi
Copied: iptables/repos/testing-x86_64/iptables.service (from rev 467451,
iptables/trunk/iptables.service)
===================================================================
--- testing-x86_64/iptables.service (rev 0)
+++ testing-x86_64/iptables.service 2023-01-27 18:46:08 UTC (rev 467452)
@@ -0,0 +1,14 @@
+[Unit]
+Description=IPv4 Packet Filtering Framework
+Before=network-pre.target
+Wants=network-pre.target
+
+[Service]
+Type=oneshot
+ExecStart=/usr/bin/iptables-restore /etc/iptables/iptables.rules
+ExecReload=/usr/bin/iptables-restore /etc/iptables/iptables.rules
+ExecStop=/usr/lib/systemd/scripts/iptables-flush
+RemainAfterExit=yes
+
+[Install]
+WantedBy=multi-user.target
Copied: iptables/repos/testing-x86_64/simple_firewall.rules (from rev 467451,
iptables/trunk/simple_firewall.rules)
===================================================================
--- testing-x86_64/simple_firewall.rules (rev 0)
+++ testing-x86_64/simple_firewall.rules 2023-01-27 18:46:08 UTC (rev
467452)
@@ -0,0 +1,11 @@
+*filter
+:INPUT DROP [0:0]
+:FORWARD DROP [0:0]
+:OUTPUT ACCEPT [0:0]
+-A INPUT -p icmp -j ACCEPT
+-A INPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
+-A INPUT -i lo -j ACCEPT
+-A INPUT -p tcp -j REJECT --reject-with tcp-reset
+-A INPUT -p udp -j REJECT --reject-with icmp-port-unreachable
+-A INPUT -j REJECT --reject-with icmp-proto-unreachable
+COMMIT