netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andre Correa <andre.correa@pobox.com>
To: netdev@oss.sgi.com
Subject: nf_unregister_hook crashing kernel
Date: Thu, 22 Apr 2004 17:51:06 -0300	[thread overview]
Message-ID: <4088303A.2080208@pobox.com> (raw)


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

             reply	other threads:[~2004-04-22 20:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-04-22 20:51 Andre Correa [this message]
  -- strict thread matches above, loose matches on Subject: below --
2004-04-22 21:08 nf_unregister_hook crashing kernel Krishna Kumar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4088303A.2080208@pobox.com \
    --to=andre.correa@pobox.com \
    --cc=netdev@oss.sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).