summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorPhil Sutter <phil@nwl.cc>2023-01-25 02:01:56 +0100
committerPhil Sutter <phil@nwl.cc>2023-01-31 16:29:26 +0100
commit27d37863a486352511dac385bde8f3d20526be5b (patch)
treed977a53130907f2522eab24d062b879384578ff5 /include
parentd6eb6a9fd3878ce4fa01f8d4127f1735988bd07b (diff)
ebtables: Refuse unselected targets' options
Unlike legacy, ebtables-nft would allow e.g.: | -t nat -A PREROUTING --to-dst fe:ed:00:00:ba:be While the result is correct, it may mislead users into believing multiple targets are possible per rule. Better follow legacy's behaviour and reject target options unless they have been "enabled" by a previous '-j' option. To achieve this, one needs to distinguish targets from watchers also attached to 'xtables_targets' and otherwise behaving like regular matches. Introduce XTABLES_EXT_WATCHER to mark the two. The above works already, but error messages are misleading when using the now unsupported syntax since target options have been merged already. Solve this by not pre-loading the targets at all, code will just fall back to loading ad '-j' parsing time as iptables does. Note how this also fixes for 'counter' statement being in wrong position of ebtables-translate output. Fixes: fe97f60e5d2a9 ("ebtables-compat: add watchers support") Signed-off-by: Phil Sutter <phil@nwl.cc>
Diffstat (limited to 'include')
-rw-r--r--include/xtables.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/xtables.h b/include/xtables.h
index 4ffc8ec5..087a1d60 100644
--- a/include/xtables.h
+++ b/include/xtables.h
@@ -203,6 +203,7 @@ struct xtables_lmap {
enum xtables_ext_flags {
XTABLES_EXT_ALIAS = 1 << 0,
+ XTABLES_EXT_WATCHER = 1 << 1,
};
struct xt_xlate;