1 /* This is a module which is used for setting up fake conntracks
2 * on packets so that they are not seen by the conntrack/NAT code.
4 #include <linux/module.h>
5 #include <linux/skbuff.h>
7 #include <linux/netfilter/x_tables.h>
8 #include <net/netfilter/nf_conntrack.h>
10 MODULE_LICENSE("GPL");
11 MODULE_ALIAS("ipt_NOTRACK");
14 target(struct sk_buff
**pskb
,
15 const struct net_device
*in
,
16 const struct net_device
*out
,
18 const struct xt_target
*target
,
21 /* Previously seen (loopback)? Ignore. */
22 if ((*pskb
)->nfct
!= NULL
)
25 /* Attach fake conntrack entry.
26 If there is a real ct entry correspondig to this packet,
27 it'll hang aroun till timing out. We don't deal with it
28 for performance reasons. JK */
29 (*pskb
)->nfct
= &nf_conntrack_untracked
.ct_general
;
30 (*pskb
)->nfctinfo
= IP_CT_NEW
;
31 nf_conntrack_get((*pskb
)->nfct
);
36 static struct xt_target xt_notrack_target
[] __read_mostly
= {
53 static int __init
xt_notrack_init(void)
55 return xt_register_targets(xt_notrack_target
,
56 ARRAY_SIZE(xt_notrack_target
));
59 static void __exit
xt_notrack_fini(void)
61 xt_unregister_targets(xt_notrack_target
, ARRAY_SIZE(xt_notrack_target
));
64 module_init(xt_notrack_init
);
65 module_exit(xt_notrack_fini
);