summaryrefslogtreecommitdiffstats
path: root/extensions/libebt_stp.c
diff options
context:
space:
mode:
authorFlorian Westphal <fw@strlen.de>2024-01-23 17:49:33 +0100
committerPhil Sutter <phil@nwl.cc>2024-01-25 15:34:01 +0100
commitee87ad419e9a0c66a0b80fd73a530af741d2629e (patch)
tree3a2a9ddde3cd6d0b4d9dd15e6b6314d43c30b0ff /extensions/libebt_stp.c
parent0a118c474924f05224b215cf38b7b3a19a9f0265 (diff)
extensions: libebt_stp: fix range checking
This has to either consider ->nvals > 1 or check the values post-no-range-fixup: ./iptables-test.py extensions/libebt_stp.t extensions/libebt_stp.t: ERROR: line 12 (cannot load: ebtables -A INPUT --stp-root-cost 1) (it tests 0 < 1 and fails, but test should be 1 < 1). Fixes: dc6efcfeac38 ("extensions: libebt_stp: Use guided option parser") Signed-off-by: Florian Westphal <fw@strlen.de> Signed-off-by: Phil Sutter <phil@nwl.cc>
Diffstat (limited to 'extensions/libebt_stp.c')
-rw-r--r--extensions/libebt_stp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/extensions/libebt_stp.c b/extensions/libebt_stp.c
index 81054b26..371fa04c 100644
--- a/extensions/libebt_stp.c
+++ b/extensions/libebt_stp.c
@@ -142,7 +142,7 @@ static void brstp_parse(struct xt_option_call *cb)
#define RANGE_ASSIGN(name, fname, val) { \
stpinfo->config.fname##l = val[0]; \
stpinfo->config.fname##u = cb->nvals > 1 ? val[1] : val[0]; \
- if (val[1] < val[0]) \
+ if (stpinfo->config.fname##u < stpinfo->config.fname##l) \
xtables_error(PARAMETER_PROBLEM, \
"Bad --stp-" name " range"); \
}