netfilter: nf_tables: Support RULE_ID reference in new rule
authorPhil Sutter <phil@nwl.cc>
Mon, 14 Jan 2019 17:41:35 +0000 (18:41 +0100)
committerPablo Neira Ayuso <pablo@netfilter.org>
Fri, 18 Jan 2019 14:02:33 +0000 (15:02 +0100)
commit75dd48e2e420a3cbbe56dd7adfcc6f142c948272
treeb4a754c639f47db6c004955442e90ed1c444c22c
parent8e2f311a68494a6677c1724bdcb10bada21af37c
netfilter: nf_tables: Support RULE_ID reference in new rule

To allow for a batch to contain rules in arbitrary ordering, introduce
NFTA_RULE_POSITION_ID attribute which works just like NFTA_RULE_POSITION
but contains the ID of another rule within the same batch. This helps
iptables-nft-restore handling dumps with mixed insert/append commands
correctly.

Note that NFTA_RULE_POSITION takes precedence over
NFTA_RULE_POSITION_ID, so if the former is present, the latter is
ignored.

Signed-off-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
include/uapi/linux/netfilter/nf_tables.h
net/netfilter/nf_tables_api.c