]> git.ipfire.org Git - thirdparty/xtables-addons.git/log
thirdparty/xtables-addons.git
4 weeks agoXtables-addons 3.26 master v3.26
Jan Engelhardt [Fri, 22 Mar 2024 17:09:34 +0000 (18:09 +0100)] 
Xtables-addons 3.26

The first Linux version to have the new SHASH stuff is Linux 4.20,
but 4.20 does not build anymore under current gcc, so it is
impractical to test, thus the requirement is bumped to the next
LT version, which is 5.4(.272) as of writing.

4 weeks agobuild: resolve 1 instance of -Wmissing-prototypes
Jan Engelhardt [Fri, 22 Mar 2024 16:58:32 +0000 (17:58 +0100)] 
build: resolve 1 instance of -Wmissing-prototypes

compat_xtables.c:30:7: warning: no previous prototype for "HX_memmem"
[-Wmissing-prototypes]

4 weeks agoxt_SYSRQ: use SHASH_DESC_ON_STACK
Matt Lawson [Wed, 13 Mar 2024 16:21:19 +0000 (12:21 -0400)] 
xt_SYSRQ: use SHASH_DESC_ON_STACK

Similar to https://codeberg.org/jengelh/xtables-addons/issues/11, the
use of the crypto library in the xt_SYSRQ causes memory corruption
and in my case, causes the kernel to lock up.

Declaring the struct shash_desc variable using the
SHASH_DESC_ON_STACK macro appears to fix the issue at least for me.

3 months agoxt_pknock: update for shash API
Jan Engelhardt [Sat, 30 Dec 2023 17:47:05 +0000 (18:47 +0100)] 
xt_pknock: update for shash API

Bug report states:

``crypto.desc`` is used to hold the ``hmac(sha256)`` transform such
that it can be fed to ``crypto_shash_update`` et al. It seems that
those functions require extra memory after the ``shash_desc``. With
the current layout, usage of ``&crypto.desc`` with the
``crypto_shash_*`` functions causes memory corruption which most
often crashes in netfilter after the pknock match filter has
returned.

By removing ``crypto.desc`` and instead using ``SHASH_DESC_ON_STACK``
within ``has_secret``, the issue can be avoided. See other
SHASH_DESC_ON_STACK uses elsewhere in the kernel source.

Additionally, ``crypto_shash_init`` needs to be called before the
first ``crypto_shash_update``.

Fixes: v2.10-7-g7af1b97
3 months agoxt_pknock: repair do_div invocation
Jan Engelhardt [Sat, 30 Dec 2023 17:06:25 +0000 (18:06 +0100)] 
xt_pknock: repair do_div invocation

do_div modifies its argument in-place. Account for that behavior.

Fixes: v3.15-1-g3aa4ca3
8 months agoXtables-addons 3.25 v3.25
Jan Engelhardt [Fri, 18 Aug 2023 15:00:10 +0000 (17:00 +0200)] 
Xtables-addons 3.25

8 months agodoc: fix version number in xtables-addons.8
Jeremy Sowden [Fri, 18 Aug 2023 14:28:28 +0000 (16:28 +0200)] 
doc: fix version number in xtables-addons.8

In v3.21 a change was made to the man-page template to use `@PACKAGE_VERSION@`,
instead of manually updating the version number on every release.  However,
xtables-addons.8.in is not processed by configure, so the appropriate version is
never filled in.

Update Makefile.mans to handle it.

Fixes: b6611c54f2b5 ("Xtables-addons 3.21")
Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
8 months agobuild: define `AM_V_GEN` where it is needed
Jeremy Sowden [Fri, 18 Aug 2023 12:38:18 +0000 (14:38 +0200)] 
build: define `AM_V_GEN` where it is needed

`AM_V_GEN` is used when generating the man-pages.  Defining it in
Makefile.iptrules is of no use.  Move the definition to the appropriate
Makefile.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
8 months agobuild: do not hard-code `AM_DEFAULT_VERBOSITY` in Makefile.iptrules
Jeremy Sowden [Fri, 18 Aug 2023 12:38:17 +0000 (14:38 +0200)] 
build: do not hard-code `AM_DEFAULT_VERBOSITY` in Makefile.iptrules

Currently it is set to zero, which means that the default in
Makefile.iptrules is not consistent with that in the other Makefiles,
and passing `--disable-silent-rules` to configure cannot be used to
change it.

Set it to `@AM_DEFAULT_VERBOSITY@` instead, which will be expanded to the
appropriate default value.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
8 months agobuild: update `AM_V_*` definitions to match autotools
Jeremy Sowden [Fri, 18 Aug 2023 12:38:16 +0000 (14:38 +0200)] 
build: update `AM_V_*` definitions to match autotools

Follow the automake documentation and use autoconf substitution variables.

Add a couple of extra trailing spaces to match the definitions generated by automake.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
8 months agobuild: replace `AM_V_silent` with `AM_V_at`
Jeremy Sowden [Fri, 18 Aug 2023 12:38:15 +0000 (14:38 +0200)] 
build: replace `AM_V_silent` with `AM_V_at`

`AM_V_silent` was buggy and defined in the wrong place.  Replace it with
`AM_V_at`, which is provided by automake for the same purpose.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
8 months agobuild: use `$(top_srcdir)` when including Makefile.extra
Jeremy Sowden [Fri, 18 Aug 2023 12:38:14 +0000 (14:38 +0200)] 
build: use `$(top_srcdir)` when including Makefile.extra

It's less fragile than using hard-coded relative paths.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
9 months agoxt_asn: add matching dump [query] utility
Philip Prindeville [Tue, 11 Jul 2023 19:48:57 +0000 (21:48 +0200)] 
xt_asn: add matching dump [query] utility

Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
9 months agoxt_asn: support quiet mode
Philip Prindeville [Mon, 10 Jul 2023 04:47:18 +0000 (06:47 +0200)] 
xt_asn: support quiet mode

Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
9 months agoxt_asn: fix download script
Philip Prindeville [Mon, 10 Jul 2023 04:37:49 +0000 (06:37 +0200)] 
xt_asn: fix download script

If the server ever existed, it's been retired now.  Use the download
server instead.

Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
10 months agoxt_ipp2p: change text-search algo to KMP
Jeremy Sowden [Mon, 12 Jun 2023 17:31:33 +0000 (19:31 +0200)] 
xt_ipp2p: change text-search algo to KMP

The kernel's Boyer-Moore text-search implementation may miss matches in
non-linear skb's, so use Knuth-Morris-Pratt instead.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
10 months agoxt_ipp2p: drop requirement that skb is linear
Jeremy Sowden [Mon, 5 Jun 2023 15:10:44 +0000 (00:10 +0900)] 
xt_ipp2p: drop requirement that skb is linear

It is no longer necessary.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
10 months agoxt_ipp2p: use skb_header_pointer and skb_find_text functions
Jeremy Sowden [Mon, 5 Jun 2023 15:10:43 +0000 (00:10 +0900)] 
xt_ipp2p: use skb_header_pointer and skb_find_text functions

Use ``skb_header_pointer`` to copy byte ranges for matching, and
``skb_find_text`` for substring searches. Doing so allows the module
to work with non-linear skbs.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
10 months agoxt_ipp2p: use textsearch API for substring searching
Jeremy Sowden [Mon, 5 Jun 2023 15:10:42 +0000 (00:10 +0900)] 
xt_ipp2p: use textsearch API for substring searching

Some of the matchers have hand-rolled substring search implementations.
Replace them with the kernel's textsearch API.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
10 months agoxt_ipp2p: rearrange some conditionals and a couple of loops
Jeremy Sowden [Mon, 5 Jun 2023 15:10:41 +0000 (00:10 +0900)] 
xt_ipp2p: rearrange some conditionals and a couple of loops

Reduce indentation and improve the readability of the code.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
10 months agoxt_ipp2p: add helper for matching "\r\n"
Jeremy Sowden [Mon, 5 Jun 2023 15:10:40 +0000 (00:10 +0900)] 
xt_ipp2p: add helper for matching "\r\n"

There are repeated checks that:

pkt[x] == 0x0d && pkt[x + 1] == 0x0a

Replace them with ``iscrlf(&pkt[x])`` function calls.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
10 months agoxt_ipp2p: change byte order conversion
Jeremy Sowden [Mon, 5 Jun 2023 15:10:39 +0000 (00:10 +0900)] 
xt_ipp2p: change byte order conversion

Instead of converting the packet bytes before comparing it to a
constant, convert the constant.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
10 months agoxt_ipp2p: fix Soulseek false positive matches
Jeremy Sowden [Mon, 5 Jun 2023 15:10:38 +0000 (00:10 +0900)] 
xt_ipp2p: fix Soulseek false positive matches

According to the comment, the last match attempted is:

14 00 00 00 01 yy 00 00 00 STRING(YY) 01 00 00 00 00 46|50 00 00 00 00

However, the conditional that inspects the last ten bytes is followed
by a semicolon, so the printk and return statements are executed
regard- less of what the last ten bytes are.

Remove the semicolon and only execute the printk and return if the
conditional expression is true.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
10 months agoxt_ipp2p: fix an off-by-one error
Jeremy Sowden [Mon, 5 Jun 2023 12:17:28 +0000 (21:17 +0900)] 
xt_ipp2p: fix an off-by-one error

When checking for waste, we check that the packet is at least eight
bytes long and then examine the first nine bytes. Fix the length check.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
11 months agoXtables-addons 3.24 v3.24
Jan Engelhardt [Sun, 30 Apr 2023 13:39:07 +0000 (15:39 +0200)] 
Xtables-addons 3.24

12 months agoDHCPMAC: resolve cppcheck warnings
Jan Engelhardt [Wed, 19 Apr 2023 23:24:15 +0000 (01:24 +0200)] 
DHCPMAC: resolve cppcheck warnings

mac.c:21:7: error: Uninitialized variable: end [uninitvar]
 if (*end == '/') {

12 months agoipv4options: resolve cppcheck warnings
Jan Engelhardt [Wed, 19 Apr 2023 23:23:28 +0000 (01:23 +0200)] 
ipv4options: resolve cppcheck warnings

libxt_ipv4options.c:123:16: error: Signed integer overflow for expression
'1<<i'. [integerOverflow]
  if (tmp & (1 << i)) {

12 months agogeoip: set autoflush on stdout
Jan Engelhardt [Sun, 9 Apr 2023 18:55:52 +0000 (20:55 +0200)] 
geoip: set autoflush on stdout

stderr is _IONBF by default on linux-glibc, but stdout only _IOLBF.
The progress updates do not use newline, so stdout needs to be
switched to _IONBF to appear in a timely fashion.

12 months agogeoip: Use stdout for output and stderr for errors/diag 6/head
Christopher Layne [Sun, 9 Apr 2023 17:24:31 +0000 (10:24 -0700)] 
geoip: Use stdout for output and stderr for errors/diag

* xt_geoip_build, xt_geoip_build_maxmind: These scripts are emitting
  "normal" output to stderr meaning that cronjobs basically have to sink
  all output in order to avoid noise. Unfortunately, by doing that, one
  also loses errors in the error case and said error might be transient.
  A simple 1>/dev/null should work for the normal cron case.

* xt_geoip_build_maxmind: Fix missing $quiet check in the v4 case.

12 months agobuild: resolve compiler warnings with gcc-13
Jan Engelhardt [Sun, 2 Apr 2023 16:37:10 +0000 (18:37 +0200)] 
build: resolve compiler warnings with gcc-13

libxt_DNETMAP.c:242:13: warning: ‘_init’ defined but not used [-Wunused-function]
  242 | static void _init(void)

12 months agodoc, src: improve spelling
Jan Engelhardt [Sun, 2 Apr 2023 16:24:10 +0000 (18:24 +0200)] 
doc, src: improve spelling

12 months agodoc, src: improve spelling
Pander [Sun, 2 Apr 2023 15:12:46 +0000 (17:12 +0200)] 
doc, src: improve spelling

13 months agoxt_geoip: bump number of territories per rule
Jan Engelhardt [Sun, 26 Feb 2023 10:55:43 +0000 (11:55 +0100)] 
xt_geoip: bump number of territories per rule

15 months agoXtables-addons 3.23 v3.23
Jan Engelhardt [Thu, 12 Jan 2023 22:32:08 +0000 (23:32 +0100)] 
Xtables-addons 3.23

15 months agobuild: support for Linux 6.2
Jeremy Sowden [Thu, 29 Dec 2022 16:35:07 +0000 (17:35 +0100)] 
build: support for Linux 6.2

`prandom_u32_max` was deprecated in favour of `get_random_u32_below`,
and removed in 6.2-rc1.  Replace the three occurrences of it in the
TARPIT extension, and ad compat support for earlier kernels.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
15 months agobuild: replace `AC_DISABLE_STATIC` macro with an argument to `LT_INIT`
Jeremy Sowden [Thu, 29 Dec 2022 16:35:06 +0000 (17:35 +0100)] 
build: replace `AC_DISABLE_STATIC` macro with an argument to `LT_INIT`

15 months agobuild: replace obsolete `AC_PROG_LIBTOOL` macro with `LT_INIT`
Jeremy Sowden [Thu, 29 Dec 2022 16:35:05 +0000 (17:35 +0100)] 
build: replace obsolete `AC_PROG_LIBTOOL` macro with `LT_INIT`

17 months agoXtables-addons 3.22 v3.22
Jan Engelhardt [Tue, 25 Oct 2022 08:43:15 +0000 (10:43 +0200)] 
Xtables-addons 3.22

17 months agobuild: support for Linux 6.1
John Thomson [Mon, 24 Oct 2022 09:58:02 +0000 (11:58 +0200)] 
build: support for Linux 6.1

6.1 commit de492c83cae0 ("prandom: remove unused functions") removed
prandom_u32, which was replaced and deprecated for get_random_u32 in
5.19 d4150779e60f ("random32: use real rng for non-deterministic
 randomness"). get_random_u32 was introduced in 4.11 c440408cf690
("random: convert get_random_int/long into get_random_u32/u64")

Use the cocci script from 81895a65ec63 ("treewide: use prandom_u32_max()
when possible, part 1"), along with a best guess for _max changes, introduced:
3.14 f337db64af05 ("random32: add prandom_u32_max and convert open coded users")

20 months agobuild: eliminate geoip/ make recursion
Jan Engelhardt [Tue, 16 Aug 2022 08:44:56 +0000 (10:44 +0200)] 
build: eliminate geoip/ make recursion

20 months agobuild: fix failure to recurse into asn/
Jan Engelhardt [Tue, 16 Aug 2022 08:43:06 +0000 (10:43 +0200)] 
build: fix failure to recurse into asn/

22 months agoxt_asn: new module
D. Stussy [Sun, 10 Mar 2019 06:45:11 +0000 (06:45 +0000)] 
xt_asn: new module

Recevied by private mail.
Date: Thu, 7 Mar 2019 00:49:16 +0000 (UTC)

"""
New feature: In thinking about various blocking of IP address groups,
I came to the conclusion that blocking by ASN may be a good
choice. Therefore, taking the lead of the geoip match module,
attached is what I have for an ASN matching module. I assume that the
support files generated will be the same format as those used for the
geoip match. [...]

I bet someone might want the ASNs on the same rule to be sorted in
numerical order. However, geoip didn't do that with country names, so
I didn't bother.

Matching by ASN may be "better" than matching by an ipset of all one
entities IP blocks (assuming that all of an entity's ASNs are known
if multiples exist). Of course, I would like to see this module make
it into your next release (3.3).  ;-)
"""

Date: Sun, 10 Mar 2019 06:45:11 +0000 (UTC)

"""
I think I got everything including the documentation and build script
this time. [...]

I noticed that some other people tried to write similar patches (saw
one on github), but those have things that were missed.

I'm running the module on my colocated server now, and it's working
well. Already blocked ASN 4134 (a botnet-infected Chinese net) a few
hundred times in the first hour.
"""

22 months agoXtables-addons 3.21 v3.21
Jan Engelhardt [Mon, 13 Jun 2022 09:11:51 +0000 (11:11 +0200)] 
Xtables-addons 3.21

22 months agoxt_ECHO: use flowi6_to_flowi_common starting Linux 5.10.121
Thomas Voegtle [Thu, 9 Jun 2022 13:19:22 +0000 (15:19 +0200)] 
xt_ECHO: use flowi6_to_flowi_common starting Linux 5.10.121

Upstream commit 3df98d79215a "lsm,selinux: pass flowi_common instead of flowi
to the LSM hooks" was backported to Linux 5.10.121 and you can't use flowi
anymore.

Lower check to 5.10.121.

Signed-off-by: Thomas Voegtle <tv@lio96.de>
23 months agodoc: fix typo in help
Jeremy Sowden [Sat, 7 May 2022 11:59:24 +0000 (13:59 +0200)] 
doc: fix typo in help

libxt_psd.c: 'threshhold' -> 'threshold'

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
23 months agodoc: fix some typos in man-pages
Jeremy Sowden [Sat, 7 May 2022 11:59:23 +0000 (13:59 +0200)] 
doc: fix some typos in man-pages

libxt_ACCOUNT.man:     'accouting' -> 'accounting'
libxt_DELUDE.man:      'belive' -> 'believe'
libxt_DHCPMAC.man:     'allow to' -> 'allow one to'
libxt_SYSRQ.man:       'allows to' -> 'allows one to'
libxt_ipv4options.man: 'allows to' -> 'allows one to'
libxt_psd.man:         'non-priviliged' -> 'non-privileged'

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
2 years agodoc: move documentation to rST format
Jan Engelhardt [Thu, 21 Apr 2022 09:31:55 +0000 (11:31 +0200)] 
doc: move documentation to rST format

2 years agoXtables-addons 3.20 v3.20
Jan Engelhardt [Sun, 10 Apr 2022 12:09:52 +0000 (14:09 +0200)] 
Xtables-addons 3.20

2 years agodoc: move changelog to rST
Jan Engelhardt [Sat, 5 Feb 2022 17:17:35 +0000 (18:17 +0100)] 
doc: move changelog to rST

2 years agodoc: remove old changelog entries
Jan Engelhardt [Sat, 5 Feb 2022 17:16:32 +0000 (18:16 +0100)] 
doc: remove old changelog entries

2 years agobuild: bump supported kernel version to 5.17
Jeremy Sowden [Fri, 4 Feb 2022 13:26:43 +0000 (14:26 +0100)] 
build: bump supported kernel version to 5.17

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
2 years agoextensions: replace PDE_DATA
Jeremy Sowden [Fri, 4 Feb 2022 13:26:42 +0000 (14:26 +0100)] 
extensions: replace PDE_DATA

The `PDE_DATA` function for retrieving private data from a procfs inode
has been replaced by `pde_data` in 5.17.  Replace all instances of the
former with the latter, but add a macro to xtables_compat.h in order to
preserve compatibility with older kernels.

Link: https://lore.kernel.org/lkml/20211124081956.87711-1-songmuchun@bytedance.com/
Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
2 years agoXtables-addons 3.19 v3.19
Jan Engelhardt [Tue, 1 Feb 2022 17:24:03 +0000 (18:24 +0100)] 
Xtables-addons 3.19

2 years agoxt_ECHO, xt_TARPIT: make properly conditional on IPv6
Philip Prindeville [Sun, 26 Sep 2021 19:57:34 +0000 (21:57 +0200)] 
xt_ECHO, xt_TARPIT: make properly conditional on IPv6

Not all modules compile equally well when CONFIG_IPv6 is disabled.

2 years agoxt_ipp2p: replace redundant ipp2p_addr
Jan Engelhardt [Tue, 14 Sep 2021 15:07:58 +0000 (17:07 +0200)] 
xt_ipp2p: replace redundant ipp2p_addr

2 years agoxt_ipp2p: add ipv6 module alias
Jeremy Sowden [Tue, 14 Sep 2021 14:09:34 +0000 (16:09 +0200)] 
xt_ipp2p: add ipv6 module alias

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
2 years agoxt_ipp2p: fix compatibility with pre-5.1 kernels
Jeremy Sowden [Mon, 13 Sep 2021 19:46:07 +0000 (21:46 +0200)] 
xt_ipp2p: fix compatibility with pre-5.1 kernels

`ip_transport_len` and `ipv6_transport_len` were introduced in 5.1.
They are both single-statement static inline functions, so add fall-back
implementations for compatibility with older kernels.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
2 years agoxt_ipp2p: add IPv6 support
Jan Engelhardt [Mon, 13 Sep 2021 09:20:51 +0000 (10:20 +0100)] 
xt_ipp2p: add IPv6 support

2 years agoxt_ipp2p: move result printing code into separate functions
Jeremy Sowden [Mon, 13 Sep 2021 09:20:50 +0000 (11:20 +0200)] 
xt_ipp2p: move result printing code into separate functions

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
2 years agoxt_ipp2p: move the protocol-specific code out into separate functions
Jeremy Sowden [Mon, 13 Sep 2021 09:20:49 +0000 (11:20 +0200)] 
xt_ipp2p: move the protocol-specific code out into separate functions

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
2 years agoxt_ipp2p: don't search haystack if it's empty
Jeremy Sowden [Mon, 13 Sep 2021 09:20:48 +0000 (11:20 +0200)] 
xt_ipp2p: don't search haystack if it's empty

All the search functions have a positive minimum packet length.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
2 years agoxt_condition: simplify clean-up of variables
Jeremy Sowden [Sun, 22 Aug 2021 16:35:56 +0000 (17:35 +0100)] 
xt_condition: simplify clean-up of variables

Unlocking early and returning in the if-block just complicate the code
to no material benefit.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
2 years agoxt_condition: do not delete variables in `condition_net_exit`
Jeremy Sowden [Sun, 22 Aug 2021 16:35:55 +0000 (17:35 +0100)] 
xt_condition: do not delete variables in `condition_net_exit`

`condition_mt_destroy` will be called for every match anyway, so we may
as well do the clean-up then, rather than duplicating it.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
2 years agoxt_condition: use condition_net::proc_net_condition to signal condition_net_exit...
Jeremy Sowden [Sun, 22 Aug 2021 16:35:54 +0000 (17:35 +0100)] 
xt_condition: use condition_net::proc_net_condition to signal condition_net_exit being called

There's no need for a separate boolean flag when we can just set
`proc_net_condition` to `NULL` after the directory has been removed.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
2 years agoxt_condition: remove `wmb` when adding new variable
Jeremy Sowden [Sun, 22 Aug 2021 16:35:53 +0000 (17:35 +0100)] 
xt_condition: remove `wmb` when adding new variable

Originally, some accesses to `conditions_list` were protected by RCU and
the memory-barrier was needed to ensure that the new variable was fully
initialized before being added to the list.  These days, however, all
accesses are protected by the `proc_lock` mutex, so the barrier is no
longer required.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
2 years agoxt_condition: make mutex per-net
Jeremy Sowden [Sun, 22 Aug 2021 16:35:52 +0000 (17:35 +0100)] 
xt_condition: make mutex per-net

The mutex protects per-net resources, so make it per-net too.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
2 years agoxt_condition: use `xt_check_proc_name` to validate /proc file name
Jeremy Sowden [Sun, 22 Aug 2021 16:35:51 +0000 (17:35 +0100)] 
xt_condition: use `xt_check_proc_name` to validate /proc file name

4.16 introduced a standard function to do the job, so let's use it.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
2 years agoxt_condition: use sizeof_field macro to size variable name
Jeremy Sowden [Sun, 22 Aug 2021 16:35:50 +0000 (17:35 +0100)] 
xt_condition: use sizeof_field macro to size variable name

4.16 introduced a macro for getting the size of a struct member, so
let's use it.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
2 years agobuild: bump minimum supported kernel version from 4.15 to 4.16
Jeremy Sowden [Sun, 22 Aug 2021 16:35:49 +0000 (17:35 +0100)] 
build: bump minimum supported kernel version from 4.15 to 4.16

The next two commits make use of a function and macro that were
introduced in 4.16.

2 years agoAdd DWARF object files to .gitignore.
Jeremy Sowden [Sat, 21 Aug 2021 10:17:24 +0000 (12:17 +0200)] 
Add DWARF object files to .gitignore.

If we build against a kernel with `CONFIG_DEBUG_INFO_SPLIT` enabled, the
kernel compiler flags will include `-gsplit-dwarf`, and the linker will
emit .dwo files.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
2 years agoMerge branch 'master' of ssh://git.code.sf.net/u/jeffcarlson72/xtables-addons
Jan Engelhardt [Mon, 16 Aug 2021 06:49:55 +0000 (08:49 +0200)] 
Merge branch 'master' of ssh://git.code.sf.net/u/jeffcarlson72/xtables-addons

2 years agopknock: added UDP options to help and made whitespace consistent
Jeff Carlson [Mon, 16 Aug 2021 01:59:25 +0000 (18:59 -0700)] 
pknock:  added UDP options to help and made whitespace consistent

2 years agolibxt_ACCOUNT_cl: correct LDFLAGS variable name
Jeremy Sowden [Sat, 14 Aug 2021 14:33:59 +0000 (16:33 +0200)] 
libxt_ACCOUNT_cl: correct LDFLAGS variable name

The LT library name is libxt_ACCOUNT_cl.la, so the variable should be
`libxt_ACCOUNT_cl_la_LDFLAGS`.

Fixes: 81ab0b9586e6 ("libxt_ACCOUNT_cl: drop padding holes from struct ipt_ACCOUNT_context")
Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
2 years agodoc: add incompatibility notice with transmogrified kernels
Jan Engelhardt [Sat, 17 Jul 2021 09:37:50 +0000 (11:37 +0200)] 
doc: add incompatibility notice with transmogrified kernels

2 years agoextensions: remove unused code from compat_xtnu.h
Jan Engelhardt [Sat, 17 Jul 2021 09:34:34 +0000 (11:34 +0200)] 
extensions: remove unused code from compat_xtnu.h

2 years agoxt_ipp2p: use fixed-size integers for struct ipt_p2p_info
Jan Engelhardt [Sat, 17 Jul 2021 09:33:20 +0000 (11:33 +0200)] 
xt_ipp2p: use fixed-size integers for struct ipt_p2p_info

2 years agoextensions: syntactically compact struct definitions
Jan Engelhardt [Sat, 17 Jul 2021 09:32:19 +0000 (11:32 +0200)] 
extensions: syntactically compact struct definitions

2 years agolibxt_ACCOUNT_cl: drop padding holes from struct ipt_ACCOUNT_context
Jan Engelhardt [Sat, 17 Jul 2021 09:31:10 +0000 (11:31 +0200)] 
libxt_ACCOUNT_cl: drop padding holes from struct ipt_ACCOUNT_context

2 years agoextensions: use simpler header guards
Jan Engelhardt [Sat, 17 Jul 2021 09:24:47 +0000 (11:24 +0200)] 
extensions: use simpler header guards

3 years agoXtables-addons 3.18 v3.18
Jan Engelhardt [Thu, 11 Mar 2021 16:13:17 +0000 (17:13 +0100)] 
Xtables-addons 3.18

3 years agoxt_pknock: fix build failure under platforms like ARM 32-bit
Jan Engelhardt [Thu, 11 Mar 2021 16:11:47 +0000 (17:11 +0100)] 
xt_pknock: fix build failure under platforms like ARM 32-bit

./arch/arm/include/asm/div64.h:24:45: note: expected "uint64_t *"
{aka "long long unsigned int *"} but argument is of type
"long unsigned int *"
   24 | static inline uint32_t __div64_32(uint64_t *n, uint32_t base)

3 years agoXtables-addons 3.17 v3.17
Jan Engelhardt [Sun, 28 Feb 2021 16:54:20 +0000 (17:54 +0100)] 
Xtables-addons 3.17

3 years agoxt_pknock: reduce indent in the two most-recently touched functions
Jan Engelhardt [Sun, 28 Feb 2021 16:48:47 +0000 (17:48 +0100)] 
xt_pknock: reduce indent in the two most-recently touched functions

3 years agoxt_pknock: cure NULL dereference
Andrew S. Johnson [Sun, 28 Feb 2021 14:54:56 +0000 (15:54 +0100)] 
xt_pknock: cure NULL dereference

The original patch for long division on x86 didn't take into account
the use of short circuit logic for checking if peer is NULL before
testing it. Here is a revised patch to v3.16.

3 years agoXtables-addons 3.16 v3.16
Jan Engelhardt [Wed, 24 Feb 2021 00:16:22 +0000 (01:16 +0100)] 
Xtables-addons 3.16

3 years agoxt_quota2: silence a compiler warning
Jan Engelhardt [Wed, 24 Feb 2021 00:12:28 +0000 (01:12 +0100)] 
xt_quota2: silence a compiler warning

libxt_quota2.c:73:3: warning: ‘strncpy’ specified bound 15 equals destination size [-Wstringop-truncation]
   73 |   strncpy(info->name, optarg, sizeof(info->name));

3 years agoxt_pknock: use do_div for long division
Andrew S. Johnson [Sun, 21 Feb 2021 14:50:50 +0000 (07:50 -0700)] 
xt_pknock: use do_div for long division

3 years agoXtables-addons 3.15 v3.15
Jan Engelhardt [Fri, 5 Feb 2021 20:55:57 +0000 (21:55 +0100)] 
Xtables-addons 3.15

3 years agoxt_pknock: replace obsolete function get_seconds
Jan Engelhardt [Fri, 5 Feb 2021 19:14:55 +0000 (20:14 +0100)] 
xt_pknock: replace obsolete function get_seconds

get_seconds is removed in 5.11; its replacement ktime_get_real_seconds
is available since 3.19. The timestamps should not be affected by clock
resets, so will be switched to ktime_get_seconds.

3 years agoxt_lscan: add --mirai option
Jan Engelhardt [Wed, 20 Jan 2021 02:06:11 +0000 (03:06 +0100)] 
xt_lscan: add --mirai option

3 years agoxt_lscan: extend info struct to support more flags (without size change)
Jan Engelhardt [Wed, 20 Jan 2021 01:50:01 +0000 (02:50 +0100)] 
xt_lscan: extend info struct to support more flags (without size change)

3 years agoxt_ECHO: support new function signature of security_skb_classify_flow
Jan Engelhardt [Wed, 20 Jan 2021 01:44:25 +0000 (02:44 +0100)] 
xt_ECHO: support new function signature of security_skb_classify_flow

3 years agoXtables-addons 3.14 v3.14
Jan Engelhardt [Tue, 24 Nov 2020 17:41:52 +0000 (18:41 +0100)] 
Xtables-addons 3.14

3 years agogeoip: use correct download URL for MaxMind DBs
Jeremy Sowden [Sun, 22 Nov 2020 14:05:30 +0000 (15:05 +0100)] 
geoip: use correct download URL for MaxMind DBs

The download URL for the GeoLite2 DBs has changed and includes a
licence key. Update the download script to read the key from file or
stdin and use the correct URL.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
3 years agoextensions: reduce number of arguments to send_reset functions
Jan Engelhardt [Mon, 23 Nov 2020 22:11:41 +0000 (23:11 +0100)] 
extensions: reduce number of arguments to send_reset functions

3 years agoextensions: call send_reset with xtables state socket
Jan Engelhardt [Sun, 22 Nov 2020 16:54:35 +0000 (17:54 +0100)] 
extensions: call send_reset with xtables state socket

Reported-by: Minqiang Chen <ptpt52@gmail.com>
3 years agobuild: cure overall build failure when CONFIG_NF_NAT=n
Jan Engelhardt [Sun, 22 Nov 2020 16:45:37 +0000 (17:45 +0100)] 
build: cure overall build failure when CONFIG_NF_NAT=n

3 years agogeoip: rename xt_geoip_fetch to xt_geoip_query
Jan Engelhardt [Sun, 22 Nov 2020 16:44:51 +0000 (17:44 +0100)] 
geoip: rename xt_geoip_fetch to xt_geoip_query

"fetch" sounds a bit like "download", but that is not what this
utility does. Calling it "query" seems more appropriate.

3 years agogeoip: add man pages for MaxMind scripts
Jeremy Sowden [Sun, 22 Nov 2020 14:05:29 +0000 (15:05 +0100)] 
geoip: add man pages for MaxMind scripts

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
3 years agodoc: fix man page typos
Jeremy Sowden [Sun, 22 Nov 2020 14:05:28 +0000 (15:05 +0100)] 
doc: fix man page typos

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>