From: Tobias DiPasquale <codeslinger@gmail.com>
To: Patrick McHardy <kaber@trash.net>
Cc: netdev <netdev@oss.sgi.com>,
linux-net <linux-net@vger.kernel.org>,
netfilter <netfilter-devel@lists.netfilter.org>
Subject: Re: deleting a conntrack record
Date: Thu, 17 Jun 2004 19:03:38 -0400 [thread overview]
Message-ID: <876ef97a04061716031a0e6000@mail.gmail.com> (raw)
In-Reply-To: <40D1C9FB.1070802@trash.net>
On Thu, 17 Jun 2004 18:42:35 +0200, Patrick McHardy <kaber@trash.net> wrote:
> In fact you shouldn't use ip_ct_selective_cleanup at all but destroy
> it yourself. You already have a reference, so there is no need to
> iterate through the entire hash.
In case anyone is interested, as a followup, the above advice works
perfectly. The code now looks like this:
<code>
static int delete_ct_record( u_int32_t src, u_int16_t sport, u_int32_t
dst, u_int16_t dport)
{
struct ip_conntrack_tuple tuple;
struct ip_conntrack_tuple_hash *h;
memset( &tuple, 0, sizeof( tuple));
tuple.src.ip = src;
tuple.src.u.tcp.port = sport;
tuple.dst.ip = dst;
tuple.dst.u.tcp.port = dport;
tuple.dst.protonum = IPPROTO_TCP;
h = ip_conntrack_find_get( &tuple, NULL);
if (!h)
return -ENOENT;
if (del_timer( &h->ctrack->timeout))
h->ctrack->timeout.function( (unsigned long)h->ctrack);
ip_conntrack_put( h->ctrack);
return 1;
}
</code>
As well, the kill_ct_record() function has been removed as it is now
useless. Thanks for all the help, Patrick especially. :)
--
[ Tobias DiPasquale ]
0x636f6465736c696e67657240676d61696c2e636f6d
next prev parent reply other threads:[~2004-06-17 23:03 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-06-17 15:07 deleting a conntrack record Tobias DiPasquale
2004-06-17 15:20 ` Antony Stone
2004-06-17 15:31 ` Tobias DiPasquale
2004-06-17 16:02 ` Patrick McHardy
2004-06-17 16:17 ` Tobias DiPasquale
2004-06-17 16:42 ` Patrick McHardy
2004-06-17 23:03 ` Tobias DiPasquale [this message]
-- strict thread matches above, loose matches on Subject: below --
2004-06-17 11:39 Tobias DiPasquale
2004-06-17 11:43 ` Tobias DiPasquale
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=876ef97a04061716031a0e6000@mail.gmail.com \
--to=codeslinger@gmail.com \
--cc=kaber@trash.net \
--cc=linux-net@vger.kernel.org \
--cc=netdev@oss.sgi.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.