[NETFILTER]: x_tables: add missing ip6t_modulename aliases
[linux-2.6/kmemtrace.git] / net / netfilter / xt_NOTRACK.c
blobfec1aefb1c326b5bdf2fd2446a3b95931c0a4f65
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.
3 */
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");
12 MODULE_ALIAS("ip6t_NOTRACK");
14 static unsigned int
15 target(struct sk_buff **pskb,
16 const struct net_device *in,
17 const struct net_device *out,
18 unsigned int hooknum,
19 const struct xt_target *target,
20 const void *targinfo)
22 /* Previously seen (loopback)? Ignore. */
23 if ((*pskb)->nfct != NULL)
24 return XT_CONTINUE;
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 */
30 (*pskb)->nfct = &nf_conntrack_untracked.ct_general;
31 (*pskb)->nfctinfo = IP_CT_NEW;
32 nf_conntrack_get((*pskb)->nfct);
34 return XT_CONTINUE;
37 static struct xt_target xt_notrack_target[] __read_mostly = {
39 .name = "NOTRACK",
40 .family = AF_INET,
41 .target = target,
42 .table = "raw",
43 .me = THIS_MODULE,
46 .name = "NOTRACK",
47 .family = AF_INET6,
48 .target = target,
49 .table = "raw",
50 .me = THIS_MODULE,
54 static int __init xt_notrack_init(void)
56 return xt_register_targets(xt_notrack_target,
57 ARRAY_SIZE(xt_notrack_target));
60 static void __exit xt_notrack_fini(void)
62 xt_unregister_targets(xt_notrack_target, ARRAY_SIZE(xt_notrack_target));
65 module_init(xt_notrack_init);
66 module_exit(xt_notrack_fini);