[iptables PATCH 06/10] extensions: libebt_mark: Drop mark_supplied check

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

 



Use of this static variable causes trouble as it affects all instances
of this target. So calling xs_init_target() for one instance invalidates
all the others.

Moving the variable into target private data seems not possible since
that would change the target's size and therefore it wouldn't match
anymore with what kernel expects.

So just get rid of it entirely. If a user "forgets" to set a mark value,
the default value of zero applies.

Signed-off-by: Phil Sutter <phil@xxxxxx>
---
 extensions/libebt_mark.c | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/extensions/libebt_mark.c b/extensions/libebt_mark.c
index 94f489e37e019..423c5c9133d0d 100644
--- a/extensions/libebt_mark.c
+++ b/extensions/libebt_mark.c
@@ -18,8 +18,6 @@
 #include "iptables/nft.h"
 #include "iptables/nft-bridge.h"
 
-static int mark_supplied;
-
 #define MARK_TARGET  '1'
 #define MARK_SETMARK '2'
 #define MARK_ORMARK  '3'
@@ -54,7 +52,6 @@ static void brmark_init(struct xt_entry_target *target)
 
 	info->target = EBT_ACCEPT;
 	info->mark = 0;
-	mark_supplied = 0;
 }
 
 #define OPT_MARK_TARGET   0x01
@@ -133,7 +130,6 @@ brmark_parse(int c, char **argv, int invert, unsigned int *flags,
 		xtables_error(PARAMETER_PROBLEM, "Bad MARK value '%s'",
 			      optarg);
 
-	mark_supplied = 1;
 	return 1;
 }
 
@@ -162,9 +158,6 @@ static void brmark_print(const void *ip, const struct xt_entry_target *target,
 
 static void brmark_final_check(unsigned int flags)
 {
-	if (mark_supplied == 0)
-		xtables_error(PARAMETER_PROBLEM, "No mark value supplied");
-
 	if (!flags)
 		xtables_error(PARAMETER_PROBLEM,
 			      "You must specify some option");
-- 
2.18.0




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

  Powered by Linux