]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
xtables: Remove target_maxnamelen field
authorPhil Sutter <phil@nwl.cc>
Thu, 11 Oct 2018 11:30:38 +0000 (13:30 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Mon, 15 Oct 2018 09:58:47 +0000 (11:58 +0200)
This is a partial revert of commit 9f075031a1973 ("Combine
parse_target() and command_jump() implementations"): Upstream prefers to
reduce max chain name length of arptables by two characters instead of
the introduced struct xtables_globals field which requires to bump
library API version.

Fixes: 9f075031a1973 ("Combine parse_target() and command_jump() implementations")
Signed-off-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
include/xtables.h
iptables/ip6tables.c
iptables/iptables.c
iptables/xshared.c
iptables/xtables-arp.c
iptables/xtables.c

index fd9e6c33516bc10c9fa30cdf0d330896a675cdac..bf169b08186f5eaacfc9d71d62315a355a7e95a4 100644 (file)
@@ -424,7 +424,6 @@ struct xtables_globals
        struct option *opts;
        void (*exit_err)(enum xtables_exittype status, const char *msg, ...) __attribute__((noreturn, format(printf,2,3)));
        int (*compat_rev)(const char *name, uint8_t rev, int opt);
-       size_t target_maxnamelen;
 };
 
 #define XT_GETOPT_TABLEEND {.name = NULL, .has_arg = false}
index 7a9cd643f8e764985ab737c1e1fb26891e5b84be..fe089de4c85d76ab166b4a449bf30e61045663e4 100644 (file)
@@ -125,7 +125,6 @@ struct xtables_globals ip6tables_globals = {
        .orig_opts = original_opts,
        .exit_err = ip6tables_exit_error,
        .compat_rev = xtables_compatible_revision,
-       .target_maxnamelen = XT_EXTENSION_MAXNAMELEN,
 };
 
 /* Table of legal combinations of commands and options.  If any of the
index b9ce64e6b32a65837cf84ce53cc8b430ea4fc0e2..f8041f56ce70daf237ad3d610ff95c6a12d184d6 100644 (file)
@@ -124,7 +124,6 @@ struct xtables_globals iptables_globals = {
        .orig_opts = original_opts,
        .exit_err = iptables_exit_error,
        .compat_rev = xtables_compatible_revision,
-       .target_maxnamelen = XT_EXTENSION_MAXNAMELEN,
 };
 
 /* Table of legal combinations of commands and options.  If any of the
index d5365d9398e902738fe8820ead32875f93769d22..b16f5fa68e56948074ca1a42dd2d3306bd38fa31 100644 (file)
@@ -641,10 +641,10 @@ const char *xt_parse_target(const char *targetname)
                xtables_error(PARAMETER_PROBLEM,
                           "Invalid target name (too short)");
 
-       if (strlen(targetname) >= xt_params->target_maxnamelen)
+       if (strlen(targetname) >= XT_EXTENSION_MAXNAMELEN)
                xtables_error(PARAMETER_PROBLEM,
-                          "Invalid target name `%s' (%zu chars max)",
-                          targetname, xt_params->target_maxnamelen - 1);
+                          "Invalid target name `%s' (%u chars max)",
+                          targetname, XT_EXTENSION_MAXNAMELEN - 1);
 
        for (ptr = targetname; *ptr; ptr++)
                if (isspace(*ptr))
index 4a782148d0f6a29707126b0d1b9e2f8999eec776..6939a611df1bbf1f943c4503ee20f874b0ef7a32 100644 (file)
@@ -158,7 +158,6 @@ struct xtables_globals arptables_globals = {
        .orig_opts              = original_opts,
        .exit_err               = xtables_exit_error,
        .compat_rev             = nft_compatible_revision,
-       .target_maxnamelen      = sizeof(arpt_chainlabel),
 };
 
 /* Table of legal combinations of commands and options.  If any of the
index c17e66f1a805f18e9f2c91034f62e81671a36aad..e0343dbabf2b3321ccc9162bd78e256b542b9dd7 100644 (file)
@@ -108,7 +108,6 @@ struct xtables_globals xtables_globals = {
        .orig_opts = original_opts,
        .exit_err = xtables_exit_error,
        .compat_rev = nft_compatible_revision,
-       .target_maxnamelen = XT_EXTENSION_MAXNAMELEN,
 };
 
 /* Table of legal combinations of commands and options.  If any of the