Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

netfilter: cttimeout: move ctnl_untimeout to nf_conntrack

As, ctnl_untimeout is required by nft_ct, so move ctnl_timeout from
nfnetlink_cttimeout to nf_conntrack_timeout and rename as nf_ct_timeout.

Signed-off-by: Harsha Sharma <harshasharmaiitr@gmail.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>

authored by

Harsha Sharma and committed by
Pablo Neira Ayuso
4e665afb 35a8a3bd

+20 -18
+1
include/net/netfilter/nf_conntrack_timeout.h
··· 83 83 #ifdef CONFIG_NF_CONNTRACK_TIMEOUT 84 84 int nf_conntrack_timeout_init(void); 85 85 void nf_conntrack_timeout_fini(void); 86 + void nf_ct_untimeout(struct net *net, struct ctnl_timeout *timeout); 86 87 #else 87 88 static inline int nf_conntrack_timeout_init(void) 88 89 {
+17
net/netfilter/nf_conntrack_timeout.c
··· 31 31 void (*nf_ct_timeout_put_hook)(struct ctnl_timeout *timeout) __read_mostly; 32 32 EXPORT_SYMBOL_GPL(nf_ct_timeout_put_hook); 33 33 34 + static int untimeout(struct nf_conn *ct, void *timeout) 35 + { 36 + struct nf_conn_timeout *timeout_ext = nf_ct_timeout_find(ct); 37 + 38 + if (timeout_ext && (!timeout || timeout_ext->timeout == timeout)) 39 + RCU_INIT_POINTER(timeout_ext->timeout, NULL); 40 + 41 + /* We are not intended to delete this conntrack. */ 42 + return 0; 43 + } 44 + 45 + void nf_ct_untimeout(struct net *net, struct ctnl_timeout *timeout) 46 + { 47 + nf_ct_iterate_cleanup_net(net, untimeout, timeout, 0, 0); 48 + } 49 + EXPORT_SYMBOL_GPL(nf_ct_untimeout); 50 + 34 51 static const struct nf_ct_ext_type timeout_extend = { 35 52 .len = sizeof(struct nf_conn_timeout), 36 53 .align = __alignof__(struct nf_conn_timeout),