Compare commits

...

6 Commits
v3.10 ... v3.11

Author SHA1 Message Date
Jan Engelhardt
20e1b669fc Xtables-addons 3.11 2020-09-06 16:35:13 +02:00
Jeremy Sowden
e4784832ed build: bump supported kernel version to 5.9
Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
2020-08-31 15:04:54 +02:00
Jeremy Sowden
48e30a0990 xt_ACCOUNT: update prototype of nf_sockopt_ops::set callback
In 5.9, the `void __user` parameter has been replaced by a `sockptr`.
Update `ipt_acc_set_ctl` appropriately.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
2020-08-31 15:04:43 +02:00
Helmut Grohne
ea588d0b9c build: do not hard-code pkg-config
Use $PKG_CONFIG in configure.ac in order to allow it to be overridden.
Fixes cross-compilation.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
2020-08-31 13:03:48 +02:00
Jeremy Sowden
96460646e9 build: clean some extra build artifacts.
Makefile.mans creates .manpages.lst, but does not remove it. Add
it to the `clean` target.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
2020-08-30 13:39:53 +02:00
Jan Engelhardt
2cb4b2bec6 build: do build & install userspace programs for xt_ACCOUNT and xt_pknock 2020-08-30 13:36:10 +02:00
7 changed files with 27 additions and 9 deletions

View File

@@ -1,7 +1,7 @@
# -*- Makefile -*- # -*- Makefile -*-
ACLOCAL_AMFLAGS = -I m4 ACLOCAL_AMFLAGS = -I m4
SUBDIRS = extensions geoip SUBDIRS = extensions extensions/ACCOUNT extensions/pknock geoip
man_MANS := xtables-addons.8 man_MANS := xtables-addons.8

View File

@@ -40,4 +40,4 @@ targets.man: .manpages.lst ${wcman_targets}
$(call man_run,${wlist_targets}) $(call man_run,${wlist_targets})
clean: clean:
rm -f xtables-addons.8 matches.man targets.man rm -f xtables-addons.8 matches.man targets.man .manpages.lst

View File

@@ -1,4 +1,4 @@
AC_INIT([xtables-addons], [3.10]) AC_INIT([xtables-addons], [3.11])
AC_CONFIG_AUX_DIR([build-aux]) AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_HEADERS([config.h]) AC_CONFIG_HEADERS([config.h])
AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_MACRO_DIR([m4])
@@ -27,7 +27,7 @@ fi
AC_CHECK_HEADERS([linux/netfilter/x_tables.h], [], AC_CHECK_HEADERS([linux/netfilter/x_tables.h], [],
[AC_MSG_ERROR([You need to have linux/netfilter/x_tables.h, see INSTALL file for details])]) [AC_MSG_ERROR([You need to have linux/netfilter/x_tables.h, see INSTALL file for details])])
PKG_CHECK_MODULES([libxtables], [xtables >= 1.6.0]) PKG_CHECK_MODULES([libxtables], [xtables >= 1.6.0])
xtlibdir="$(pkg-config --variable=xtlibdir xtables)" xtlibdir="$($PKG_CONFIG --variable=xtlibdir xtables)"
AC_ARG_WITH([xtlibdir], AC_ARG_WITH([xtlibdir],
AS_HELP_STRING([--with-xtlibdir=PATH], AS_HELP_STRING([--with-xtlibdir=PATH],
@@ -57,7 +57,7 @@ if test -n "$kbuilddir"; then
echo "WARNING: Version detection did not succeed. Continue at own luck."; echo "WARNING: Version detection did not succeed. Continue at own luck.";
else else
echo "$kmajor.$kminor.$kmicro.$kstable in $kbuilddir"; echo "$kmajor.$kminor.$kmicro.$kstable in $kbuilddir";
if test "$kmajor" -gt 5 -o "$kmajor" -eq 5 -a "$kminor" -gt 8; then if test "$kmajor" -gt 5 -o "$kmajor" -eq 5 -a "$kminor" -gt 9; then
echo "WARNING: That kernel version is not officially supported yet. Continue at own luck."; echo "WARNING: That kernel version is not officially supported yet. Continue at own luck.";
elif test "$kmajor" -eq 5 -a "$kminor" -ge 0; then elif test "$kmajor" -eq 5 -a "$kminor" -ge 0; then
: :

View File

@@ -1,3 +1,8 @@
v3.11 (2020-09-06)
==================
- Support for up to Linux 5.9
v3.10 (2020-07-28) v3.10 (2020-07-28)
================== ==================
- Support for up to Linux 5.8 - Support for up to Linux 5.8

View File

@@ -28,6 +28,9 @@
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/string.h> #include <linux/string.h>
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 9, 0)
#include <linux/sockptr.h>
#endif
#include <linux/spinlock.h> #include <linux/spinlock.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
#include <net/netns/generic.h> #include <net/netns/generic.h>
@@ -879,7 +882,12 @@ static int ipt_acc_handle_get_data(struct ipt_acc_net *ian,
} }
static int ipt_acc_set_ctl(struct sock *sk, int cmd, static int ipt_acc_set_ctl(struct sock *sk, int cmd,
void *user, unsigned int len) #if LINUX_VERSION_CODE < KERNEL_VERSION(5, 9, 0)
void *user,
#else
sockptr_t arg,
#endif
unsigned int len)
{ {
struct net *net = sock_net(sk); struct net *net = sock_net(sk);
struct ipt_acc_net *ian = net_generic(net, ipt_acc_net_id); struct ipt_acc_net *ian = net_generic(net, ipt_acc_net_id);
@@ -898,7 +906,12 @@ static int ipt_acc_set_ctl(struct sock *sk, int cmd,
break; break;
} }
if (copy_from_user(&handle, user, len)) { #if LINUX_VERSION_CODE < KERNEL_VERSION(5, 9, 0)
if (copy_from_user(&handle, user, len))
#else
if (copy_from_sockptr(&handle, arg, len))
#endif
{
printk("ACCOUNT: ipt_acc_set_ctl: copy_from_user failed for " printk("ACCOUNT: ipt_acc_set_ctl: copy_from_user failed for "
"IPT_SO_SET_HANDLE_FREE\n"); "IPT_SO_SET_HANDLE_FREE\n");
break; break;

View File

@@ -5,4 +5,4 @@ AM_CFLAGS = ${regular_CFLAGS} ${libxtables_CFLAGS}
include ../../Makefile.extra include ../../Makefile.extra
noinst_PROGRAMS = pknlusr sbin_PROGRAMS = pknlusr

View File

@@ -1,4 +1,4 @@
.TH xtables-addons 8 "" "" "v3.9 (2020-02-25)" .TH xtables-addons 8 "" "" "v3.11 (2020-09-06)"
.SH Name .SH Name
Xtables-addons \(em additional extensions for iptables, ip6tables, etc. Xtables-addons \(em additional extensions for iptables, ip6tables, etc.
.SH Targets .SH Targets