]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
xtables: remove xtables_set_revision function
authorJan Engelhardt <jengelh@medozas.de>
Mon, 7 Jun 2010 10:00:24 +0000 (12:00 +0200)
committerJan Engelhardt <jengelh@medozas.de>
Mon, 7 Jun 2010 10:00:24 +0000 (12:00 +0200)
Since iptables uses its own copies of the header files anyway where the
revision field is exposed, there is no reach to access name[] beyond its
size.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
configure.ac
include/xtables.h.in
ip6tables.c
iptables.c
xtables.c

index ba723bf3822b9a43a8e38510c8709b620915fac4..dd74a895b6fdf1e94ef079055fd706cd754c9726 100644 (file)
@@ -2,7 +2,7 @@
 AC_INIT([iptables], [1.4.8])
 
 # See libtool.info "Libtool's versioning system"
-libxtables_vcurrent=4
+libxtables_vcurrent=5
 libxtables_vage=0
 
 AC_CONFIG_HEADERS([config.h])
index 788ad7de3767cd14d84fdbc34cffe81c2cceb7fa..2d7df322b365ce8b04da72c971fcf0fb328362e1 100644 (file)
@@ -216,7 +216,6 @@ extern void *xtables_realloc(void *, size_t);
 extern int xtables_insmod(const char *, const char *, bool);
 extern int xtables_load_ko(const char *, bool);
 extern int xtables_set_params(struct xtables_globals *xtp);
-extern void xtables_set_revision(char *name, u_int8_t revision);
 extern void xtables_free_opts(int reset_offset);
 extern struct option *xtables_merge_options(struct option *oldopts,
        const struct option *newopts, unsigned int *option_offset);
index 2fff21bf4ac62203a6b714a40a200377fcef0c60..6c5d124c0c9c188eb4ff05fdb42b0d268b3c6793 100644 (file)
@@ -1558,8 +1558,7 @@ int do_command6(int argc, char *argv[], char **table, struct ip6tc_handle **hand
                                target->t = xtables_calloc(1, size);
                                target->t->u.target_size = size;
                                strcpy(target->t->u.user.name, jumpto);
-                               xtables_set_revision(target->t->u.user.name,
-                                            target->revision);
+                               target->t->u.user.revision = target->revision;
                                if (target->init != NULL)
                                        target->init(target->t);
                                opts = xtables_merge_options(opts,
@@ -1611,7 +1610,7 @@ int do_command6(int argc, char *argv[], char **table, struct ip6tc_handle **hand
                        m->m = xtables_calloc(1, size);
                        m->m->u.match_size = size;
                        strcpy(m->m->u.user.name, m->name);
-                       xtables_set_revision(m->m->u.user.name, m->revision);
+                       m->m->u.user.revision = m->revision;
                        if (m->init != NULL)
                                m->init(m->m);
                        if (m != m->next)
@@ -1759,8 +1758,7 @@ int do_command6(int argc, char *argv[], char **table, struct ip6tc_handle **hand
                                        m->m = xtables_calloc(1, size);
                                        m->m->u.match_size = size;
                                        strcpy(m->m->u.user.name, m->name);
-                                       xtables_set_revision(m->m->u.user.name,
-                                                    m->revision);
+                                       m->m->u.user.revision = m->revision;
                                        if (m->init != NULL)
                                                m->init(m->m);
 
index efe993e18babcc1fcc85b1929b84605eeff37f89..19f6d4fe3657d48aa368d9d6468389217c738446 100644 (file)
@@ -1573,8 +1573,7 @@ int do_command(int argc, char *argv[], char **table, struct iptc_handle **handle
                                target->t = xtables_calloc(1, size);
                                target->t->u.target_size = size;
                                strcpy(target->t->u.user.name, jumpto);
-                               xtables_set_revision(target->t->u.user.name,
-                                            target->revision);
+                               target->t->u.user.revision = target->revision;
                                if (target->init != NULL)
                                        target->init(target->t);
                                opts = xtables_merge_options(opts,
@@ -1632,7 +1631,7 @@ int do_command(int argc, char *argv[], char **table, struct iptc_handle **handle
                        m->m = xtables_calloc(1, size);
                        m->m->u.match_size = size;
                        strcpy(m->m->u.user.name, m->name);
-                       xtables_set_revision(m->m->u.user.name, m->revision);
+                       m->m->u.user.revision = m->revision;
                        if (m->init != NULL)
                                m->init(m->m);
                        if (m != m->next) {
@@ -1787,8 +1786,7 @@ int do_command(int argc, char *argv[], char **table, struct iptc_handle **handle
                                        m->m = xtables_calloc(1, size);
                                        m->m->u.match_size = size;
                                        strcpy(m->m->u.user.name, m->name);
-                                       xtables_set_revision(m->m->u.user.name,
-                                                    m->revision);
+                                       m->m->u.user.revision = m->revision;
                                        if (m->init != NULL)
                                                m->init(m->m);
 
@@ -1947,8 +1945,7 @@ int do_command(int argc, char *argv[], char **table, struct iptc_handle **handle
                        target->t->u.target_size = size;
                        strcpy(target->t->u.user.name, jumpto);
                        if (!iptc_is_chain(jumpto, *handle))
-                               xtables_set_revision(target->t->u.user.name,
-                                            target->revision);
+                               target->t->u.user.revision = target->revision;
                        if (target->init != NULL)
                                target->init(target->t);
                }
index b4c4f6b326a501c13bb49522ae29e5bc331bebb7..ed082f3fb452e9c92dee66cd4f74d6a4bc15d386 100644 (file)
--- a/xtables.c
+++ b/xtables.c
@@ -114,14 +114,6 @@ struct option *xtables_merge_options(struct option *oldopts,
        return merge;
 }
 
-void xtables_set_revision(char *name, u_int8_t revision)
-{
-       /* Old kernel sources don't have ".revision" field,
-       *            but we stole a byte from name. */
-       name[XT_FUNCTION_MAXNAMELEN - 2] = '\0';
-       name[XT_FUNCTION_MAXNAMELEN - 1] = revision;
-}
-
 /**
  * xtables_afinfo - protocol family dependent information
  * @kmod:              kernel module basename (e.g. "ip_tables")