netfilter: nf_tables: reject destroy command to remove basechain hooks
authorPablo Neira Ayuso <pablo@netfilter.org>
Thu, 21 Mar 2024 00:27:50 +0000 (01:27 +0100)
committerPablo Neira Ayuso <pablo@netfilter.org>
Thu, 28 Mar 2024 02:54:01 +0000 (03:54 +0100)
commitb32ca27fa238ff83427d23bef2a5b741e2a88a1e
treea38c4a1918f5ad75148aa2eb804d66c0299b4cef
parentd24b03535e5eb82e025219c2f632b485409c898f
netfilter: nf_tables: reject destroy command to remove basechain hooks

Report EOPNOTSUPP if NFT_MSG_DESTROYCHAIN is used to delete hooks in an
existing netdev basechain, thus, only NFT_MSG_DELCHAIN is allowed.

Fixes: 7d937b107108f ("netfilter: nf_tables: support for deleting devices in an existing netdev chain")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/netfilter/nf_tables_api.c