Results 1 to 2 of 2
Hi all,
I am writing a kernel module that hooks into netfilter.
netfilter_ops.hook = main_hook;
netfilter_ops.pf = PF_INET;
netfilter_ops.hooknum = NF_IP_PRE_ROUTING;
netfilter_ops.priority = NF_IP_PRI_FIRST;
nf_register_hook(&netfilter_ops);
In the main_hook function, I ...
- 07-10-2008 #1Just Joined!
- Join Date
- Jul 2008
- Posts
- 1
Netfilter module help
Hi all,
I am writing a kernel module that hooks into netfilter.
netfilter_ops.hook = main_hook;
netfilter_ops.pf = PF_INET;
netfilter_ops.hooknum = NF_IP_PRE_ROUTING;
netfilter_ops.priority = NF_IP_PRI_FIRST;
nf_register_hook(&netfilter_ops);
In the main_hook function, I needs to put the process to sleep and
will be woken up by another process because the decision to Accept or
Deny a packet depends on a process running in the user space. However,
all sleeping mechanisms I tried cause the kernel hang. I tried msleep,
wait_event_interrupt,wait_event_interrupt_timeout, ... (of course I
have a process to wake up the main_hook process). I tested these
sleeping machenisms in different modules and they worked fine. My
question is can we make the process sleep in the main_hook function
without causing the kernel hang and how to do it?
Thank you very much.
Tung.
- 08-02-2008 #2
i just want to know ur purpose to put the module in the sleep... cause pkts on n/w interface r not gonna stop.... and whenever u give NF_QUEUE it'll queue it up and send it to userspace.... where u can process and pass the verdict down to kernel....
also i want to ask u.... hv u tried capturing the pkts in multiple threads???


Reply With Quote
