Q: Any other way on handling "conntrack DESTROY" without ip_conntrack_destroyed()
I have a requirement:
=====================
1.When a conntrack is created, I'll allocate memory for my private data, if the associated connect is what I am interested on. 2.And as the conntrack is destroyed for the connect is absolutely closed or timeout, I'll then release the memory of my private data.
The note(1) is easy to be done, but note(2) in some way is much more complex.
Currently I have two ideas on note(2):
======================================
1.Register a handle of the "void (*ip_conntrack_destroyed)()" in "ip_conntract_core.c" on my module's init function. 2.I implement the state and timeout tracking of my own in the module.
For idea(1), There'll be in conflict with the NAT, because the NAT uses the hook.(ip_nat_core.c:ip_nat_init()&:ip_nat_cleanup()) For idea(2), I'll repeat the ip_conntrack's alogrithm, ALSO be not a good idea...
Then can I implement it in another way?
Such as: the conntrack support me one safty hook on conntrack destroy...(I think there is no such hooks)
Quoted 7 lines · qhou
I have a requirement:
=====================
1.When a conntrack is created, I'll allocate memory for my private data, if the associated connect is what I am interested on.2.And as the conntrack is destroyed for the connect is absolutely closed or timeout, I'll then release the memory of my private data.
What are you implementing? A layer four helper (like ip_conntrack_proto_tcp.c?)
In CVS is a patch which adds a proto->destroy function to the l4 proto helpers (ip_conntrack_protocol_destroy.patch)
Signature · 5 lines
Live long and prosper - Harald Welte / [email protected] http://www.gnumonks.org/ ============================================================================ GCS/E/IT d- s-: a-- C+++ UL++++$ P+++ L++++$ E--- W- N++ o? K- w--- O- M- V-- PS+ PE-- Y+ PGP++ t++ 5-- !X !R tv-- b+++ DI? !D G+ e* h+ r% y+(*)