diff options
author | David S. Miller <davem@davemloft.net> | 2020-08-04 13:32:39 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-08-04 13:32:39 -0700 |
commit | ee895a30ef463e3ebaa5cbe464346d9fbbce1860 (patch) | |
tree | 00755eb8853e291fb9ed57d7f33630f77cebb9ad /include/net | |
parent | bab9693a9a8c6dd19f670408ec1e78e12a320682 (diff) | |
parent | 4203b19c27967d9eff6928f6a733f81892ffc592 (diff) | |
download | linux-stable-ee895a30ef463e3ebaa5cbe464346d9fbbce1860.tar.gz linux-stable-ee895a30ef463e3ebaa5cbe464346d9fbbce1860.tar.bz2 linux-stable-ee895a30ef463e3ebaa5cbe464346d9fbbce1860.zip |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf
Pablo Neira Ayuso says:
====================
Netfilter fixes for net
The following patchset contains Netfilter fixes for net:
1) Flush the cleanup xtables worker to make sure destructors
have completed, from Florian Westphal.
2) iifgroup is matching erroneously, also from Florian.
3) Add selftest for meta interface matching, from Florian Westphal.
4) Move nf_ct_offload_timeout() to header, from Roi Dayan.
5) Call nf_ct_offload_timeout() from flow_offload_add() to
make sure garbage collection does not evict offloaded flow,
from Roi Dayan.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net')
-rw-r--r-- | include/net/netfilter/nf_conntrack.h | 12 | ||||
-rw-r--r-- | include/net/netfilter/nf_tables.h | 2 |
2 files changed, 14 insertions, 0 deletions
diff --git a/include/net/netfilter/nf_conntrack.h b/include/net/netfilter/nf_conntrack.h index 90690e37a56f..c7bfddfc65b0 100644 --- a/include/net/netfilter/nf_conntrack.h +++ b/include/net/netfilter/nf_conntrack.h @@ -279,6 +279,18 @@ static inline bool nf_ct_should_gc(const struct nf_conn *ct) !nf_ct_is_dying(ct); } +#define NF_CT_DAY (86400 * HZ) + +/* Set an arbitrary timeout large enough not to ever expire, this save + * us a check for the IPS_OFFLOAD_BIT from the packet path via + * nf_ct_is_expired(). + */ +static inline void nf_ct_offload_timeout(struct nf_conn *ct) +{ + if (nf_ct_expires(ct) < NF_CT_DAY / 2) + ct->timeout = nfct_time_stamp + NF_CT_DAY; +} + struct kernel_param; int nf_conntrack_set_hashsize(const char *val, const struct kernel_param *kp); diff --git a/include/net/netfilter/nf_tables.h b/include/net/netfilter/nf_tables.h index 822c26766330..bf9491b77d16 100644 --- a/include/net/netfilter/nf_tables.h +++ b/include/net/netfilter/nf_tables.h @@ -1507,4 +1507,6 @@ void nft_chain_filter_fini(void); void __init nft_chain_route_init(void); void nft_chain_route_fini(void); + +void nf_tables_trans_destroy_flush_work(void); #endif /* _NET_NF_TABLES_H */ |