]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
tc: m_xt: Fix segfault with iptables-1.6.0
authorPhil Sutter <phil@nwl.cc>
Thu, 12 Jan 2017 14:22:49 +0000 (15:22 +0100)
committerStephen Hemminger <stephen@networkplumber.org>
Fri, 13 Jan 2017 01:32:26 +0000 (17:32 -0800)
Said iptables version introduced struct xtables_globals field
'compat_rev', a function pointer. Initializing it is mandatory as
libxtables calls it without existence check.

Without this, tc segfaults when using the xt action like so:

| tc filter add dev d0 parent ffff: u32 match u32 0 0 \
| action xt -j MARK --set-mark 20

Signed-off-by: Phil Sutter <phil@nwl.cc>
tc/m_xt.c

index dbb54981462ee5211574044a23387b1fac4ccd63..57ed40d7aa3a8d9a6f221629da31adc25244e66c 100644 (file)
--- a/tc/m_xt.c
+++ b/tc/m_xt.c
@@ -77,6 +77,9 @@ static struct xtables_globals tcipt_globals = {
        .orig_opts = original_opts,
        .opts = original_opts,
        .exit_err = NULL,
+#if (XTABLES_VERSION_CODE >= 11)
+       .compat_rev = xtables_compatible_revision,
+#endif
 };
 
 /*