]> git.baikalelectronics.ru Git - kernel.git/commit
netfilter: nfnetlink: allow to check for generation ID
authorPablo Neira Ayuso <pablo@netfilter.org>
Fri, 10 Feb 2017 11:08:17 +0000 (12:08 +0100)
committerPablo Neira Ayuso <pablo@netfilter.org>
Sun, 12 Feb 2017 13:45:11 +0000 (14:45 +0100)
commit175695f99f07d7db2e6c834be0889fe84a9b3b93
treee8ce0acf10108f74d0ce8cd150f061baff0686bf
parent1d5beabe9f2b4b92d8274844ab5a5502c70aa23e
netfilter: nfnetlink: allow to check for generation ID

This patch allows userspace to specify the generation ID that has been
used to build an incremental batch update.

If userspace specifies the generation ID in the batch message as
attribute, then nfnetlink compares it to the current generation ID so
you make sure that you work against the right baseline. Otherwise, bail
out with ERESTART so userspace knows that its changeset is stale and
needs to respin. Userspace can do this transparently at the cost of
taking slightly more time to refresh caches and rework the changeset.

This check is optional, if there is no NFNL_BATCH_GENID attribute in the
batch begin message, then no check is performed.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
include/linux/netfilter/nfnetlink.h
include/uapi/linux/netfilter/nfnetlink.h
net/netfilter/nfnetlink.c