]> git.ipfire.org Git - thirdparty/nftables.git/commit
libnftables: location-based error reporting for chain type
authorPablo Neira Ayuso <pablo@netfilter.org>
Wed, 19 May 2021 19:57:41 +0000 (21:57 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Wed, 19 May 2021 22:13:35 +0000 (00:13 +0200)
commit5008798157e2114f9fc47bff46e4e6f03c9c7a14
tree5c8385d44a563e4cd87ec9bffa6c6c294d51c3cc
parent2acf8b2caea19d8abd46d475a908f8d6afb33aa0
libnftables: location-based error reporting for chain type

Store the location of the chain type for better error reporting.

Several users that compile custom kernels reported that error
reporting is misleading when accidentally selecting
CONFIG_NFT_NAT=n.

After this patch, a better hint is provided:

 # nft 'add chain x y { type nat hook prerouting priority dstnat; }'
 Error: Could not process rule: No such file or directory
 add chain x y { type nat hook prerouting priority dstnat; }
                      ^^^

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