connection destruction question
Thank you, that does interest me. It does seem to match my needs more closely than the other patch. I also have realized that my approach of making a helper module to be notified when connections were created wasn't going to work since I realized it would only be called on the master connection and not on any of the related connections, and I need to see state changes for all connections. I will take a look at the patch and see if it works out.
By the way, what are your plans for this patch? I always hate the idea of using a patch I actually have to maintain myself :), although of course I will do that if that's what it takes to get my job done.
Kristen
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Unit Zero
Sent: Friday, March 19, 2004 7:34 AM
To: Kristen Carlson
Cc: [email protected]
Subject: Re: connection destruction question
Quoted 8 lines · Kristen Carlson
Hello,
Is there a way to be notified in a kernel module when a connection is destroyed? I have a nice helper module that would like to know when connections are destroyed so it can do some internal cleanup work.
Thanks,
Kristen
Actually I ran into the exact same issue not long ago with a module I've
been working on. My solution was to add a couple lines here and there in
conntrack_core.c and ip_conntrack.h to implement a notifier chain and export register/unregister routines from the ip_conntrack module, allowing
other modules to add callback functions to the chain. The notifier chain
is then called from various parts of the conntrack_core code with an event-code and a struct ip_conntrack ptr reference when conntracks are created, destroyed (either explicitly or by timeout), become confirmed, or become replied.
I've got a small patch that I put together about a month ago which has my modifications described above. I'm pretty sure it will apply cleanly to a 2.4.24-25 kernel source tree, but if not the modifications are pretty
straight forward. Just thought it might be of interest.
- V. M. Condino