9 #include <linux/types.h>
11 #include <linux/netfilter.h>
12 #include <linux/module.h>
17 #include <linux/netfilter_bridge.h>
18 #include <linux/netfilter_ipv4.h>
20 #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE)
47 #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE)
49 zone = nf_ct_zone((
struct nf_conn *)skb->nfct);
52 #ifdef CONFIG_BRIDGE_NETFILTER
54 skb->nf_bridge->mask & BRNF_NF_BRIDGE_PREROUTING)
63 static unsigned int ipv4_conntrack_defrag(
unsigned int hooknum,
72 if (sk && (sk->sk_family ==
PF_INET) &&
76 #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE)
77 #if !defined(CONFIG_NF_NAT) && !defined(CONFIG_NF_NAT_MODULE)
80 if (skb->nfct && !nf_ct_is_template((
struct nf_conn *)skb->nfct))
85 if (ip_is_fragment(ip_hdr(skb))) {
87 if (nf_ct_ipv4_gather_frags(skb, user))
93 static struct nf_hook_ops ipv4_defrag_ops[] = {
95 .hook = ipv4_conntrack_defrag,
102 .hook = ipv4_conntrack_defrag,
110 static int __init nf_defrag_init(
void)
115 static void __exit nf_defrag_fini(
void)