- 626 名前:login:Penguin [2005/11/07(月) 23:13:39 ID:ERcKGA8X]
- カーネル2.6.Xで、netfilterフックに関する↓のコードをinsmodすると、
パニックしてしまいます。なぜでしょうか。教えてエロい人。 #include <linux/module.h> #include <linux/skbuff.h> #include <linux/netfilter.h> #include <linux/netfilter_ipv4.h> static unsigned int incomming(unsigned int hooknum, struct sk_buff **pskb, const struct net_device *in, const struct net_device *out, int (*okfn)(struct sk_buff *)) { printk("hello!\n"); return NF_ACCEPT; } static struct nf_hook_ops giveme = {{NULL, NULL}, incomming, NULL, PF_INET, NF_IP_POST_ROUTING, INT_MAX}; int init_module(void) { if (nf_register_hook(&giveme) != 0) { printk("rate nf_register_hook failed\n"); return -1; } return 0; } void cleaup_module(void) { nf_unregister_hook(&giveme); }
|

|