]> git.ipfire.org Git - thirdparty/nftables.git/commit
src: create element command
authorPablo Neira Ayuso <pablo@netfilter.org>
Wed, 24 Aug 2016 14:45:06 +0000 (16:45 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Thu, 25 Aug 2016 12:21:56 +0000 (14:21 +0200)
commitfd33d964a94063d7af6f1713350df980cf440503
tree6421d4b11926d51f0cc91ad26d17f4faabb3f3a1
parente0f8c894982a57cb1772640715737c7477e7ef8d
src: create element command

This patch adds the create command, that send the NLM_F_EXCL flag so
nf_tables bails out if the element already exists, eg.

 # nft add element x y { 1.1.1.1 }
 # nft create element x y { 1.1.1.1 }
 <cmdline>:1:1-31: Error: Could not process rule: File exists
 create element x y { 1.1.1.1 }
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

This update requires nf_tables kernel patches to honor the NLM_F_EXCL.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
include/netlink.h
src/netlink.c
src/parser_bison.y
src/rule.c