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_compat.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,
22 /* Previously seen (loopback)? Ignore. */
23 if ((*pskb)->nfct != NULL)
26 /* Attach fake conntrack entry.
27 If there is a real ct entry correspondig to this packet,
28 it'll hang aroun till timing out. We don't deal with it
29 for performance reasons. JK */
31 (*pskb)->nfctinfo = IP_CT_NEW;
32 nf_conntrack_get((*pskb)->nfct);
37 static struct xt_target notrack_reg = {
46 static struct xt_target notrack6_reg = {
55 static int __init xt_notrack_init(void)
59 ret = xt_register_target(¬rack_reg);
63 ret = xt_register_target(¬rack6_reg);
65 xt_unregister_target(¬rack_reg);
70 static void __exit xt_notrack_fini(void)
72 xt_unregister_target(¬rack6_reg);
73 xt_unregister_target(¬rack_reg);
76 module_init(xt_notrack_init);
77 module_exit(xt_notrack_fini);