compat: nf_defrag_ipv6: avoid nf_iterate recursion.
[cascardo/ovs.git] / datapath / linux / compat / include / net / netfilter / ipv6 / nf_defrag_ipv6.h
1 #ifndef _NF_DEFRAG_IPV6_WRAPPER_H
2 #define _NF_DEFRAG_IPV6_WRAPPER_H
3
4 #include <linux/kconfig.h>
5
6 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)
7 #include_next <net/netfilter/ipv6/nf_defrag_ipv6.h>
8 #endif
9
10 /* Upstream commit 029f7f3b8701 ("netfilter: ipv6: nf_defrag: avoid/free clone
11  * operations") changed the semantics of nf_ct_frag6_gather(), so we backport
12  * it for all prior kernels.
13  */
14 #if defined(HAVE_NF_CT_FRAG6_CONSUME_ORIG) || \
15     defined(HAVE_NF_CT_FRAG6_OUTPUT)
16 #define OVS_NF_DEFRAG6_BACKPORT 1
17 int rpl_nf_ct_frag6_gather(struct net *net, struct sk_buff *skb, u32 user);
18 #define nf_ct_frag6_gather rpl_nf_ct_frag6_gather
19 #endif /* HAVE_NF_CT_FRAG6_CONSUME_ORIG */
20
21 #ifdef OVS_NF_DEFRAG6_BACKPORT
22 int __init rpl_nf_ct_frag6_init(void);
23 void rpl_nf_ct_frag6_cleanup(void);
24 #else /* !OVS_NF_DEFRAG6_BACKPORT */
25 static inline int __init rpl_nf_ct_frag6_init(void) { return 0; }
26 static inline void rpl_nf_ct_frag6_cleanup(void) { }
27 #endif /* OVS_NF_DEFRAG6_BACKPORT */
28 #define nf_ct_frag6_init rpl_nf_ct_frag6_init
29 #define nf_ct_frag6_cleanup rpl_nf_ct_frag6_cleanup
30
31 #endif /* __NF_DEFRAG_IPV6_WRAPPER_H */