[iptables PATCH] xtables: Remove target_maxnamelen field

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxx>
---
 include/xtables.h      | 1 -
 iptables/ip6tables.c   | 1 -
 iptables/iptables.c    | 1 -
 iptables/xshared.c     | 6 +++---
 iptables/xtables-arp.c | 1 -
 iptables/xtables.c     | 1 -
 6 files changed, 3 insertions(+), 8 deletions(-)

diff --git a/include/xtables.h b/include/xtables.h
index fd9e6c33516bc..bf169b08186f5 100644
--- a/include/xtables.h
+++ b/include/xtables.h
@@ -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}
diff --git a/iptables/ip6tables.c b/iptables/ip6tables.c
index 7a9cd643f8e76..fe089de4c85d7 100644
--- a/iptables/ip6tables.c
+++ b/iptables/ip6tables.c
@@ -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
diff --git a/iptables/iptables.c b/iptables/iptables.c
index b9ce64e6b32a6..f8041f56ce70d 100644
--- a/iptables/iptables.c
+++ b/iptables/iptables.c
@@ -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
diff --git a/iptables/xshared.c b/iptables/xshared.c
index d5365d9398e90..b16f5fa68e569 100644
--- a/iptables/xshared.c
+++ b/iptables/xshared.c
@@ -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))
diff --git a/iptables/xtables-arp.c b/iptables/xtables-arp.c
index 4a782148d0f6a..6939a611df1bb 100644
--- a/iptables/xtables-arp.c
+++ b/iptables/xtables-arp.c
@@ -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
diff --git a/iptables/xtables.c b/iptables/xtables.c
index c17e66f1a805f..e0343dbabf2b3 100644
--- a/iptables/xtables.c
+++ b/iptables/xtables.c
@@ -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
-- 
2.19.0




[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux