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@nwl.cc>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
#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'
info->target = EBT_ACCEPT;
info->mark = 0;
- mark_supplied = 0;
}
#define OPT_MARK_TARGET 0x01
xtables_error(PARAMETER_PROBLEM, "Bad MARK value '%s'",
optarg);
- mark_supplied = 1;
return 1;
}
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");