]> git.ipfire.org Git - thirdparty/xtables-addons.git/log
thirdparty/xtables-addons.git
2 years 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.

2 years 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)

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

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

2 years 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

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

2 years 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>
2 years 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`

2 years 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`

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

2 years 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")

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

2 years 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/

3 years 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.
"""

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

3 years 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>
3 years 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>
3 years 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>
3 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

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

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

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

3 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>
3 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>
3 years agoXtables-addons 3.19 v3.19
Jan Engelhardt [Tue, 1 Feb 2022 17:24:03 +0000 (18:24 +0100)] 
Xtables-addons 3.19

3 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.

3 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

3 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>
3 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>
3 years agoxt_ipp2p: add IPv6 support
Jan Engelhardt [Mon, 13 Sep 2021 09:20:51 +0000 (10:20 +0100)] 
xt_ipp2p: add IPv6 support

3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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.

3 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>
3 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

3 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

3 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>
4 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

4 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

4 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

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

4 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

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

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

4 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)

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

4 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

4 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.

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

4 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));

4 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

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

4 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.

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

4 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)

4 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

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

4 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>
4 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

4 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>
4 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

4 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.

4 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>
4 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>
4 years agogeoip: remove superfluous xt_geoip_fetch_maxmind script
Jeremy Sowden [Sun, 22 Nov 2020 14:05:27 +0000 (15:05 +0100)] 
geoip: remove superfluous xt_geoip_fetch_maxmind script

xt_geoip_fetch and xt_geoip_fetch_maxmind are identical. Remove the
latter.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
4 years agoXtables-addons 3.13 v3.13
Jan Engelhardt [Fri, 20 Nov 2020 12:03:06 +0000 (13:03 +0100)] 
Xtables-addons 3.13

4 years agocompat_xtables: employ route_me_harder define for 4.19 and 5.4 too
Jan Engelhardt [Fri, 20 Nov 2020 12:01:17 +0000 (13:01 +0100)] 
compat_xtables: employ route_me_harder define for 4.19 and 5.4 too

The API change found its way into some more Linux stable series.

4 years agoXtables-addons 3.12 v3.12
Jan Engelhardt [Thu, 19 Nov 2020 11:30:46 +0000 (12:30 +0100)] 
Xtables-addons 3.12

4 years agocompat_xtables: fix a spello near route_me_harder
Jan Engelhardt [Thu, 19 Nov 2020 21:11:13 +0000 (22:11 +0100)] 
compat_xtables: fix a spello near route_me_harder

4 years agoxt_DNETMAP: compaction of variable declarations
Jan Engelhardt [Thu, 19 Nov 2020 12:41:23 +0000 (13:41 +0100)] 
xt_DNETMAP: compaction of variable declarations

4 years agogeoip: re-add Maxmind scripts
Philip Prindeville [Mon, 25 May 2020 20:05:42 +0000 (14:05 -0600)] 
geoip: re-add Maxmind scripts

4 years agoextensions: abolish NIPQUAD/NIP6
Jan Engelhardt [Thu, 19 Nov 2020 11:52:57 +0000 (12:52 +0100)] 
extensions: abolish NIPQUAD/NIP6

Support for Linux 2.6.28 is long gone.

4 years agobuild: adjust for changed signature of ip_route_me_harder
Jan Engelhardt [Thu, 19 Nov 2020 11:28:55 +0000 (12:28 +0100)] 
build: adjust for changed signature of ip_route_me_harder

(Cf. commit 46d6c5ae953cc0be38efd0e469284df7c4328cf8 in Linux.)

4 years agopknlusr: mention the group ID command-line paramater in the man page
Jeremy Sowden [Sun, 25 Oct 2020 18:15:51 +0000 (19:15 +0100)] 
pknlusr: mention the group ID command-line paramater in the man page

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
4 years agopknock: trim some blank lines
Jan Engelhardt [Mon, 26 Oct 2020 10:06:57 +0000 (11:06 +0100)] 
pknock: trim some blank lines

4 years agoextensions: split assignments and if-exprs
Jan Engelhardt [Sun, 25 Oct 2020 14:41:24 +0000 (15:41 +0100)] 
extensions: split assignments and if-exprs

4 years agoxt_pknock: remove DEBUG definition and disable debug output
Jeremy Sowden [Sun, 25 Oct 2020 13:15:59 +0000 (14:15 +0100)] 
xt_pknock: remove DEBUG definition and disable debug output

The DEBUG definition in xt_pknock.h causes a compiler warning if one
adds a DEBUG define to xt_pknock.c to enable pr_debug. Since it only
controls some debugging output in libxt_pknock.c, it would make sense to
move the definition there, but let's just disable the debugging instead.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
4 years agoxt_pknock: use `pr_err`
Jeremy Sowden [Sun, 25 Oct 2020 13:15:58 +0000 (14:15 +0100)] 
xt_pknock: use `pr_err`

Replace some instances of `printk(KERN_ERR PKNOCK ...)`. We define
`pr_fmt`, so `pr_err` is equivalent.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
4 years agoxt_pknock: use kzalloc
Jeremy Sowden [Sun, 25 Oct 2020 13:15:57 +0000 (14:15 +0100)] 
xt_pknock: use kzalloc

Replace some instances of kmalloc + memset.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
4 years agoxt_pknock: use IS_ENABLED
Jeremy Sowden [Sun, 25 Oct 2020 13:15:56 +0000 (14:15 +0100)] 
xt_pknock: use IS_ENABLED

It is more succinct than checking whether CONFIG_BLAH or
CONFIG_BLAH_MODULE are defined.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
4 years agopknlusr: fix hard-coded netlink multicast group ID
Jeremy Sowden [Sun, 25 Oct 2020 13:15:55 +0000 (14:15 +0100)] 
pknlusr: fix hard-coded netlink multicast group ID

The group ID used by xt_pknock is configurable, but pknlusr hard-codes
it. Modify pknlusr to accept an optional ID from the command line.
Group IDs range from 1 to 32 and each ID appears in the group bitmask
at position `group_id - 1`.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
4 years agopknlusr: always close socket
Jeremy Sowden [Sun, 25 Oct 2020 13:15:54 +0000 (14:15 +0100)] 
pknlusr: always close socket

On some error paths, the socket was not being closed before exit.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
4 years agopknlusr: do not treat recv return value of zero as an error
Jeremy Sowden [Sun, 25 Oct 2020 13:15:53 +0000 (14:15 +0100)] 
pknlusr: do not treat recv return value of zero as an error

A return-value of zero is not an error, so there is no point calling
perror, but since we have not requested and do not expect a zero-length
datagram, we treat it as EOF and exit.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
4 years agopknlusr: use macro to define inet_ntop buffer size
Jeremy Sowden [Sun, 25 Oct 2020 13:15:52 +0000 (14:15 +0100)] 
pknlusr: use macro to define inet_ntop buffer size

POSIX provides a macro to define the minimum length required, so let's
use it.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
4 years agopknlusr: use NLMSG macros and proper types, rather than arithmetic on char pointers
Jeremy Sowden [Sun, 25 Oct 2020 13:15:51 +0000 (14:15 +0100)] 
pknlusr: use NLMSG macros and proper types, rather than arithmetic on char pointers

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
4 years agopknlusr: tidy up initialization of local address
Jeremy Sowden [Sun, 25 Oct 2020 13:15:50 +0000 (14:15 +0100)] 
pknlusr: tidy up initialization of local address

Use struct initialization and drop memset. We do not need to set the port
ID, since the kernel will do it for us.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
4 years agopknock: pknlusr: tighten up variable scopes
Jeremy Sowden [Sun, 25 Oct 2020 13:15:49 +0000 (14:15 +0100)] 
pknock: pknlusr: tighten up variable scopes

Make global variables local, and move variables local to while-loop into
the loop.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
4 years agopknock: pknlusr: remove dest_addr and rename src_addr
Jeremy Sowden [Sun, 25 Oct 2020 13:15:48 +0000 (14:15 +0100)] 
pknock: pknlusr: remove dest_addr and rename src_addr

We only need to specify the address at our end, and given that we are
receiving messages, not sending them, calling it `src_addr` is
misleading.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
4 years agopknock: pknlusr: ensure man-page is included by `make dist`
Jeremy Sowden [Sun, 25 Oct 2020 13:15:47 +0000 (14:15 +0100)] 
pknock: pknlusr: ensure man-page is included by `make dist`

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
4 years agopknlusr: add man page
Jeremy Sowden [Thu, 22 Oct 2020 17:30:05 +0000 (19:30 +0200)] 
pknlusr: add man page

Since pknlusr is now being installed, let's give it a man page.

4 years agopknlusr: fix formatting of a line
Jeremy Sowden [Thu, 22 Oct 2020 17:30:03 +0000 (19:30 +0200)] 
pknlusr: fix formatting of a line

4 years agoXtables-addons 3.11 v3.11
Jan Engelhardt [Sun, 6 Sep 2020 14:35:13 +0000 (16:35 +0200)] 
Xtables-addons 3.11