| To: | Andre Correa <andre.correa@xxxxxxxxx> |
|---|---|
| Subject: | Re: nf_unregister_hook crashing kernel |
| From: | Krishna Kumar <kumarkr@xxxxxxxxxx> |
| Date: | Thu, 22 Apr 2004 14:08:04 -0700 |
| Cc: | netdev@xxxxxxxxxxx |
| Sender: | netdev-bounce@xxxxxxxxxxx |
|
If you do a nf_register_queue_handler, you need nf_unregister_queue_handler. Can't mix
Hi list, I'm playing with a module that uses netfilter hooks. It register using nf_register_hook without problems, but when I try nf_unregister_hook in my "cleanup" function the kernel crashs. I've found that it crashs calling nf_unregister_hook, but have no idea how to debug it further... Here goes some snips from my code. Nothing new. I've searched other modules and found that everybody makes the same. ...<snip>... static nf_hookfn my_nf_hook; static struct nf_hook_ops my_ingress_ipv4 = { .hook = my_nf_hook, .owner = THIS_MODULE, .pf = PF_INET, .hooknum = NF_IP_PRE_ROUTING, .priority = NF_IP_PRI_MANGLE + 1 }; ...<snip>... static unsigned int my_nf_hook(unsigned int hook, struct sk_buff **pskb, const struct net_device *indev, const struct net_device *outdev, int (*okfn)(struct sk_buff *)) { if ((*pskb)->my_flags & MY_F_ENQUEUE) return NF_QUEUE; return NF_ACCEPT; } ...<snip>... static int __init my_init_hooks(void) { int err; if ((err = nf_register_queue_handler(PF_INET, my_nf_queue, NULL))) return err; } ...<snip>.... static void __exit my_unhook(void) { nf_unregister_hook(&my_ingress_ipv4); } ...<snip>... module_init(my_init_module); module_exit(my_cleanup_module); MODULE_LICENSE("GPL"); Like I said, nothing new. Is there anybody who can give me some info on how/when can nf_unregister_hook crash the kernel? How can I debug some more?! Tks in advance for any help. Andre |
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | Re: tcp vulnerability? haven't seen anything on it here..., Willy Tarreau |
|---|---|
| Next by Date: | Re: tcp vulnerability? haven't seen anything on it here..., Florian Weimer |
| Previous by Thread: | nf_unregister_hook crashing kernel, Andre Correa |
| Next by Thread: | TCP rto estimation patch, Wesley Eddy |
| Indexes: | [Date] [Thread] [Top] [All Lists] |