aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/netfilter
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2017-02-10 12:08:17 +0100
committerPablo Neira Ayuso <pablo@netfilter.org>2017-02-12 14:45:11 +0100
commit8c4d4e8b5626fec965fd5034e5bd5e57790f243f (patch)
treee8ce0acf10108f74d0ce8cd150f061baff0686bf /include/linux/netfilter
parentnetfilter: nfnetlink: add nfnetlink_rcv_skb_batch() (diff)
downloadlinux-dev-8c4d4e8b5626fec965fd5034e5bd5e57790f243f.tar.xz
linux-dev-8c4d4e8b5626fec965fd5034e5bd5e57790f243f.zip
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>
Diffstat (limited to 'include/linux/netfilter')
-rw-r--r--include/linux/netfilter/nfnetlink.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/netfilter/nfnetlink.h b/include/linux/netfilter/nfnetlink.h
index 1d82dd5e9a08..1b49209dd5c7 100644
--- a/include/linux/netfilter/nfnetlink.h
+++ b/include/linux/netfilter/nfnetlink.h
@@ -28,6 +28,7 @@ struct nfnetlink_subsystem {
const struct nfnl_callback *cb; /* callback for individual types */
int (*commit)(struct net *net, struct sk_buff *skb);
int (*abort)(struct net *net, struct sk_buff *skb);
+ bool (*valid_genid)(struct net *net, u32 genid);
};
int nfnetlink_subsys_register(const struct nfnetlink_subsystem *n);