From: Pablo Neira <pablo@eurodev.net>
To: Josh Samuelson <josamue1@wsc.edu>
Cc: Netfilter Development Mailinglist <netfilter-devel@lists.netfilter.org>
Subject: Re: [PATCH 1/2] updates for [nf|ct]netlink and event API
Date: Wed, 29 Jun 2005 21:14:07 +0200 [thread overview]
Message-ID: <42C2F2FF.1060408@eurodev.net> (raw)
In-Reply-To: <20050628234425.GA23662@wsc.edu>
Hi Josh,
Josh Samuelson wrote:
> On Mon, Jun 27, 2005 at 08:02:22PM +0200, Pablo Neira wrote:
>
>>o conntrack event API
>
>
>>- IPCT_DELIVERED bit. Loopback reports event are reported twice, this
>>bit is set once event are delivered. I just came up with a better idea,
>>reset nfcache once the events have been delivered, but I'll apply this
>>change in the next patchset.
>
> I noticed this with my flow module, any interface connecting to itself
> would create two IPCT_NEW events. I had made my own patch to your
> linux-2.6.11.conntrack-event-api.patch to call
> ip_conntrack_event_cache_init() after the events were delivered.
Indeed, this is what I planned to fix this problem ;). Just killed the
IPCT_DELIVERED bit, it will be included in next version of the
ctevent-api. I'll post it soon.
> I was gonna send it your way but other things came up and there
> were other problems that I was trying to figure out that were not
> quite working the way I thought they should. I investigated
> further and think I've found the problem, but I'm not sure
> how to move further on it, so now it's time to ask the list:
>
> Can anyone explain why in ip_conntrack_proto_icmp.c
> we delete the conntrack of an ICMP packet as soon as all replies
> are seen instead of letting ip_conntrack_icmp_timeout take the
> conntrack like other protocol types? As far as I can see, this
> breaks the conntrack event API because I get the following
> sequence of notifications for an ICMP echo request to the host
> (this is with the ip_conntrack_event_cache_init() patch after
> notifications have been delivered so I don't get two IPCT_NEW events):
>
> IPCT_NEW
> IPCT_DESTROY
> IPCT_STATUS
>
> I think nfct->use is still held and the conntrack is never really
> destroyed after death_by_timeout(), so later when the reply comes
> the conntrack still exists in the hash and the conntrack API
> fires a IPCT_STATUS event after the IPCT_DESTROY event was fired,
> which I'm assuming is an invalid sequence of events. ;)
OK, I moved the IPCT_DESTROY event to destroy_conntrack instead of
death_by_timeout, this must fix the problem of out of sequence events.
> So, what would be the harm in the following patch to
> ip_conntrack_proto_icmp.c?
>
> diff -u a/ip_conntrack_proto_icmp.c b/ip_conntrack_proto_icmp.c
> --- a/ip_conntrack_proto_icmp.c 2005-06-28 16:52:18.000000000 -0500
> +++ b/ip_conntrack_proto_icmp.c 2005-06-28 16:52:46.000000000 -0500
> @@ -92,15 +92,7 @@
> const struct sk_buff *skb,
> enum ip_conntrack_info ctinfo)
> {
> - /* Try to delete connection immediately after all replies:
> - won't actually vanish as we still have skb, and del_timer
> - means this will only run once even if count hits zero twice
> - (theoretically possible with SMP) */
> - if (CTINFO2DIR(ctinfo) == IP_CT_DIR_REPLY) {
> - if (atomic_dec_and_test(&ct->proto.icmp.count)
> - && del_timer(&ct->timeout))
> - ct->timeout.function((unsigned long)ct);
> - } else {
> + if (CTINFO2DIR(ctinfo) != IP_CT_DIR_REPLY) {
> atomic_inc(&ct->proto.icmp.count);
> ip_ct_refresh_acct(ct, ctinfo, skb, ip_ct_icmp_timeout);
> }
I don't want to change the current icmp tracking logic, the connection
tracking table could get full sooner because of icmp entries that has
already seen their reply wanting to timeout.
--
Pablo
next prev parent reply other threads:[~2005-06-29 19:14 UTC|newest]
Thread overview: 50+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-06-27 18:02 [PATCH 1/2] updates for [nf|ct]netlink and event API Pablo Neira
2005-06-27 20:26 ` Harald Welte
2005-06-28 2:00 ` Pablo Neira
2005-06-28 2:12 ` Pablo Neira
2005-06-28 2:15 ` Pablo Neira
2005-06-28 3:53 ` Patrick McHardy
2005-06-28 7:07 ` Harald Welte
2005-07-04 12:59 ` Amin Azez
2005-06-28 7:06 ` Harald Welte
2005-06-27 21:31 ` Patrick McHardy
2005-06-28 2:15 ` Pablo Neira
2005-06-28 3:56 ` Patrick McHardy
2005-06-27 22:40 ` Patrick McHardy
2005-06-28 2:16 ` Pablo Neira
2005-06-28 4:03 ` Patrick McHardy
2005-06-28 7:13 ` Harald Welte
2005-06-28 16:02 ` Patrick McHardy
2005-06-29 19:13 ` Pablo Neira
2005-06-29 19:52 ` Patrick McHardy
2005-06-29 20:16 ` Harald Welte
2005-06-30 0:27 ` Pablo Neira
2005-06-30 0:53 ` Patrick McHardy
2005-06-30 9:47 ` Pablo Neira
2005-06-30 21:30 ` Patrick McHardy
2005-06-30 0:34 ` Pablo Neira
2005-06-30 1:00 ` Patrick McHardy
2005-06-30 1:49 ` Thomas Graf
2005-06-30 1:53 ` Patrick McHardy
2005-06-30 12:03 ` Thomas Graf
2005-06-30 13:27 ` Patrick McHardy
2005-06-30 18:02 ` Thomas Graf
2005-06-30 21:26 ` Patrick McHardy
2005-06-30 21:34 ` Thomas Graf
2005-06-30 21:49 ` David S. Miller
2005-06-30 22:08 ` Thomas Graf
2005-06-30 22:08 ` David S. Miller
2005-06-30 17:06 ` ctnetlink attributes [was: Re: [PATCH 1/2] updates for [nf|ct]netlink and event API] Pablo Neira
2005-07-11 16:30 ` Amin Azez
2005-07-11 16:50 ` Jan Engelhardt
2005-07-11 17:11 ` Harald Welte
2005-07-11 17:40 ` Jan Engelhardt
2005-07-12 7:54 ` Harald Welte
2005-07-11 17:10 ` Harald Welte
2005-07-11 17:45 ` Jan Engelhardt
2005-07-12 7:55 ` Harald Welte
2005-07-12 8:18 ` Amin Azez
2005-06-28 23:44 ` [PATCH 1/2] updates for [nf|ct]netlink and event API Josh Samuelson
2005-06-29 19:14 ` Pablo Neira [this message]
2005-07-11 11:34 ` NETLINK_NETFILTER and NETLINK_FIB_LOOKUP Amin Azez
2005-07-11 16:32 ` [PATCH 1/2] updates for [nf|ct]netlink and event API Amin Azez
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=42C2F2FF.1060408@eurodev.net \
--to=pablo@eurodev.net \
--cc=josamue1@wsc.edu \
--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.