]> git.baikalelectronics.ru Git - kernel.git/commit
netfilter: nf_tables: Allow set back-ends to report partial overlaps on insertion
authorPablo Neira Ayuso <pablo@netfilter.org>
Sun, 22 Mar 2020 02:21:58 +0000 (03:21 +0100)
committerPablo Neira Ayuso <pablo@netfilter.org>
Tue, 24 Mar 2020 18:58:57 +0000 (19:58 +0100)
commitf41a331c150b81be0d2a193de4bdc7a534e23d64
tree9d1e3ba2f9f85469583c0af71dc528329a3425fe
parentfb6d5bcadb926c14c545fe95f10a19a54845ad19
netfilter: nf_tables: Allow set back-ends to report partial overlaps on insertion

Currently, the -EEXIST return code of ->insert() callbacks is ambiguous: it
might indicate that a given element (including intervals) already exists as
such, or that the new element would clash with existing ones.

If identical elements already exist, the front-end is ignoring this without
returning error, in case NLM_F_EXCL is not set. However, if the new element
can't be inserted due an overlap, we should report this to the user.

To this purpose, allow set back-ends to return -ENOTEMPTY on collision with
existing elements, translate that to -EEXIST, and return that to userspace,
no matter if NLM_F_EXCL was set.

Reported-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/netfilter/nf_tables_api.c