From netfilter-devel Mon Apr 18 11:22:47 2005 From: Wang Jian Date: Mon, 18 Apr 2005 11:22:47 +0000 To: netfilter-devel Subject: Re: double call to ip_conntrack_put() ? Message-Id: <20050418192122.037D.LARK () linux ! net ! cn> X-MARC-Message: https://marc.info/?l=netfilter-devel&m=111382339117377 Hi Amin Azez, Yes, I am also confused by the _put for a while until I read the code. IMHO, it's more clear to rename it to _release. On Mon, 18 Apr 2005 12:02:31 +0100, Amin Azez wrote: > Tobias DiPasquale wrote: > > This is intended. tuplehash_to_ctrack() generates a reference to the > > conntrack record. In death_by_timeout() the refcount is decremented, > > yielding 1 for the second call to ip_conntrack_put(). The dec_and_test > > in nf_conntrack_put() (called by ip_conntrack_put()) will result in a > > refcount of 0, sending the record to the destroy_conntrack() function > > (or more properly, whatever's registered in nfct->destroy(), which I'm > > pretty sure is always either NULL or destroy_conntrack()). > > What I found confusing initially was that "put" in "ip_conntrack_put" > means "release" or "refcount--" instead of "write" or "store" which > would have been my first guess. > > Sam Azez > -- lark