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.
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.
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)
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.
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.
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.
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.
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`.
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.
Jeremy Sowden [Tue, 21 Jul 2020 13:03:45 +0000 (14:03 +0100)]
doc: fix quoted string in libxt_DNETMAP manpage
In roff, lines beginning with a single quote are control lines. In the
libxt_DNETMAP man-page there is a single-quoted string at the beginning
of a line, which troff tries and fails to interpret as a macro:
troff: <standard input>:49: warning: macro 'S'' not defined
This means that the line is not output.
Replace the single quotes with the appropriate escape-sequences.
Fixes: v2.3~9 ("doc: spelling and grammar corrections to DNETMAP") Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
Conceivably someone might want to run a refresh of the geoip database
from within a script, particularly an unattended script such as a cron
job. Do not generate output in that case.
Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
The Perl script that builds the GeoIP DBs uses inet_pton(3) to convert
the addresses to network byte order. This converts
"1234:5678::90ab:cdef"
to:
0x12 0x34 0x56 0x78 .. 0xcd 0xef, interpreted by an LE machine
accessing this in uint32_t-sized chunks as
8765:4321::fedc:ba09
The kernel module compares the addresses in packets with the ranges from
the DB in host byte order using binary search. It uses 32-bit swaps
when converting the addresses.
libxt_geoip, however, which the module uses to load the ranges from the
DB and convert them from NBO to HBO, uses 16-bit swaps to do so, and
this means that:
1234:5678::90ab:cdef
becomes:
4321:8765::ba09:fedc
Obviously, this is inconsistent with the kernel module and DB build
script and breaks the binary search.
Fixes: b91dbd03c717 ("geoip: store database in network byte order") Reported-by: "Thomas B. Clark" <kernel@clark.bz> Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
Jeremy Sowden [Sun, 11 Aug 2019 13:09:26 +0000 (14:09 +0100)]
xt_DHCPMAC: replace skb_make_writable with skb_ensure_writable
skb_make_writable was removed from the kernel in
v5.3-rc1~140^2~370^2~1 , and its callers were converted to use
skb_ensure_writable. Updated dhcpmac_tg() accordingly.