Netfilter module help
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;
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.
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???