]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commit
netfilter: nf_tables: missing error reporting for not selected expressions
authorPablo Neira Ayuso <pablo@netfilter.org>
Wed, 19 May 2021 11:32:20 +0000 (13:32 +0200)
committerStefan Bader <stefan.bader@canonical.com>
Wed, 30 Jun 2021 06:27:59 +0000 (08:27 +0200)
commit2f8bc514956518ab99206e5e6477c62465dbf8bb
treeae731cc83f2f191edd8986ceb8d3a90490a11122
parent3f2e66e1791341f977d4f0a2f46c94e6eb250105
netfilter: nf_tables: missing error reporting for not selected expressions

BugLink: https://bugs.launchpad.net/bugs/1933691
commit c781471d67a56d7d4c113669a11ede0463b5c719 upstream.

Sometimes users forget to turn on nftables extensions from Kconfig that
they need. In such case, the error reporting from userspace is
misleading:

 $ sudo nft add rule x y counter
 Error: Could not process rule: No such file or directory
 add rule x y counter
 ^^^^^^^^^^^^^^^^^^^^

Add missing NL_SET_BAD_ATTR() to provide a hint:

 $ nft add rule x y counter
 Error: Could not process rule: No such file or directory
 add rule x y counter
              ^^^^^^^

Fixes: 83d9dcba06c5 ("netfilter: nf_tables: extended netlink error reporting for expressions")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kelsey Skunberg <kelsey.skunberg@canonical.com>
net/netfilter/nf_tables_api.c