All of lore.kernel.org
 help / color / mirror / Atom feed
From: Patrick McHardy <kaber@trash.net>
To: Damon Gray <dgray@internap.com>
Cc: netfilter-devel@lists.netfilter.org
Subject: Re: ip_conntrack_get doesn't call nf_conntrack_get(&ct->ct_general)
Date: Fri, 02 Sep 2005 00:05:15 +0200	[thread overview]
Message-ID: <43177B1B.4010207@trash.net> (raw)
In-Reply-To: <Pine.LNX.4.62.0509011526550.14997@dgray-test.acs.internap.com>

Damon Gray wrote:
> 
> Until I looked more closely I always assumed ip_conntrack_get was doing
> the proper reference counting, and I would always call ip_conntrack_put
> for everything I was "getting". The problem is that ip_conntrack_put calls
> nf_conntrack_put(&ct->ct_general) but ip_conntrack_get *does not* call
> nf_conntrack_get(&ct->ct_general). Problem? If so I would be happy to
> send a patch.

This is one of the uglies of ip_conntrack. ip_conntrack_get just returns
the nfct pointer from the skb and the nfctinfo field in *ctinfo, without
increasing the refcnt, refcounting is done using nf_conntrack_get.
Before nfctinfo was introduced, ctinfo it had to be derived from the
nfct pointer, which is why ip_conntrack_get exists. Cleanup patches in
this area would be very welcome, but it should be done for nf_conntrack,
which copied this part of ip_conntrack.

      reply	other threads:[~2005-09-01 22:05 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-01 18:58 problem with connlimit module compile Keith
2005-09-01 19:08 ` Damon Gray
2005-09-01 19:43 ` ip_conntrack_get doesn't call nf_conntrack_get(&ct->ct_general) Damon Gray
2005-09-01 22:05   ` Patrick McHardy [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=43177B1B.4010207@trash.net \
    --to=kaber@trash.net \
    --cc=dgray@internap.com \
    --cc=netfilter-devel@lists.netfilter.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.