summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Engelhardt <jengelh@medozas.de>2009-03-30 00:44:46 +0200
committerJan Engelhardt <jengelh@medozas.de>2009-04-03 20:51:31 +0200
commitc4edfa63eda06f02cc5bc1a65d366c55bd2eda30 (patch)
tree88c8994afd5ab8413d6ed23944af6ab2858d1ca8
parentcdf51d0183213c4bcac9ef4818155c1d3fbb897e (diff)
libxtables: reorder .version member
When the structure's layout changes, as it did between v1.4.1 and v1.4.2, trying to compare the version string makes iptables segfault while it tries to determine whether the module is compatible in the first place. By moving the member to a known offset in the struct and keeping it there, objects (both iptables and 3rd party) compiled from this commit onwards will avoid the segfault. Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
-rw-r--r--configure.ac2
-rw-r--r--include/xtables.h.in16
2 files changed, 14 insertions, 4 deletions
diff --git a/configure.ac b/configure.ac
index 87f693f8..656bd372 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2,7 +2,7 @@
AC_INIT([iptables], [1.4.3.1])
# See libtool.info "Libtool's versioning system"
-libxtables_vcurrent=1
+libxtables_vcurrent=2
libxtables_vage=0
AC_CONFIG_HEADERS([config.h])
diff --git a/include/xtables.h.in b/include/xtables.h.in
index d86276e7..a399f90f 100644
--- a/include/xtables.h.in
+++ b/include/xtables.h.in
@@ -37,6 +37,12 @@ struct in_addr;
/* Include file for additions: new matches and targets. */
struct xtables_match
{
+ /*
+ * ABI/API version this module requires. Must be first member,
+ * as the rest of this struct may be subject to ABI changes.
+ */
+ const char *version;
+
struct xtables_match *next;
const char *name;
@@ -46,8 +52,6 @@ struct xtables_match
u_int16_t family;
- const char *version;
-
/* Size of match data. */
size_t size;
@@ -93,8 +97,15 @@ struct xtables_match
struct xtables_target
{
+ /*
+ * ABI/API version this module requires. Must be first member,
+ * as the rest of this struct may be subject to ABI changes.
+ */
+ const char *version;
+
struct xtables_target *next;
+
const char *name;
/* Revision of target (0 by default). */
@@ -102,7 +113,6 @@ struct xtables_target
u_int16_t family;
- const char *version;
/* Size of target data. */
size_t size;