All of lore.kernel.org
 help / color / mirror / Atom feed
From: Henrik Nordstrom <henrik@henriknordstrom.net>
To: Thomas Mader <thezema@gmail.com>
Cc: netfilter-devel@lists.netfilter.org
Subject: Re: switch from ip_conntrack to nf_conntrack
Date: Fri, 23 Feb 2007 00:54:21 +0100	[thread overview]
Message-ID: <1172188461.544.63.camel@henriknordstrom.net> (raw)
In-Reply-To: <20070221085835.173c691b@Golgotha>

[-- Attachment #1: Type: text/plain, Size: 994 bytes --]

ons 2007-02-21 klockan 08:58 +0100 skrev Thomas Mader:
> Hello everybody,
> 
> we wrote a kernelspace module which uses the now deprecated
> ip_conntrack API and we are trying to switch to the new nf_conntrack
> but this seems to be a little bit more problematic than we thought
> first.
> What we want is to build a nf_conntrack_tuple to get the hash for an
> existing connection and finally the id of the connection.

Looking at your code I don't quite get why you need to build the tuple
again or ask for the conntrack hash lookup. Isn't you looking for the
conntrack associated with the packet sent to the match function? If so
just ask for it with nf_ct_get() as it's already associated with the
sk_buff and no need to look it up in the conntrack hash. To keep a
reference outside the match function scope use
nf_conntrack_get/nf_conntrack_put to maintain the lock count. While you
are inside the match function the conntrack is locked by the sk_buff.

Regards
Henrik

[-- Attachment #2: Detta är en digitalt signerad meddelandedel --]
[-- Type: application/pgp-signature, Size: 307 bytes --]

      reply	other threads:[~2007-02-22 23:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-21  7:58 switch from ip_conntrack to nf_conntrack Thomas Mader
2007-02-22 23:54 ` Henrik Nordstrom [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=1172188461.544.63.camel@henriknordstrom.net \
    --to=henrik@henriknordstrom.net \
    --cc=netfilter-devel@lists.netfilter.org \
    --cc=thezema@gmail.com \
    /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.