summaryrefslogtreecommitdiffstats
path: root/iptables/xshared.h
diff options
context:
space:
mode:
authorPhil Sutter <phil@nwl.cc>2019-10-22 22:49:29 +0200
committerPhil Sutter <phil@nwl.cc>2019-10-30 10:00:57 +0100
commit45989e8fbec52fcbafa5ae9917fc2a0d62e3640d (patch)
treea39778ab0d5875aec2f2e2c6a4d3f465006f248f /iptables/xshared.h
parent8e502b02ef911cb8c05ea58acd7e2a4c397d1831 (diff)
xshared: Share a common add_command() implementation
The shared definition of cmdflags is a super set of the previous one in xtables-arp.c so while not being identical, they're compatible. Avoid accidental array overstep in cmd2char() by incrementing an index variable and checking its final value before using it as such. Signed-off-by: Phil Sutter <phil@nwl.cc> Acked-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'iptables/xshared.h')
-rw-r--r--iptables/xshared.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/iptables/xshared.h b/iptables/xshared.h
index 64b7e8fc..0b9b357c 100644
--- a/iptables/xshared.h
+++ b/iptables/xshared.h
@@ -183,4 +183,8 @@ void command_match(struct iptables_command_state *cs);
const char *xt_parse_target(const char *targetname);
void command_jump(struct iptables_command_state *cs, const char *jumpto);
+char cmd2char(int option);
+void add_command(unsigned int *cmd, const int newcmd,
+ const int othercmds, int invert);
+
#endif /* IPTABLES_XSHARED_H */