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>
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}
.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
.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
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))
.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
.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