Hello,
I am working on a kernel module that hooks into NF_OUTPUT and
NF_PRE_ROUTING and the two separate functions share some data
structures. I was under the impression that only one packet could be
processed at a time, so for example if the function in NF_PRE_ROUTING is
called, the NF_OUTPUT-function will have to wait until the other has
finished processing.
However, I have a bug in my module that I can't find an explanation for
and the sympthom is a typical shared-resource error. Both functions work
on the same list (created using the functions in linux/list.h) and
sometimes, for no apparent reason, the kernel crashes. I suspect this is
caused by one function deleting an element the other is working on, but
I have not been able to prove it and is not sure how to do it.
So my question is, can the one function be called before the other is
finished and will I need som synchronization? I see that klist.h offers
this automaticually, what is the difference between list and klist?
Thank you very much for any help,
Kristian
--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ