From: Rui Sousa <rui.p.m.sousa@gmail.com>
To: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: [PATCH] conntrack event missing TCP protoinfo
Date: Mon, 4 Jan 2010 19:03:21 +0100 [thread overview]
Message-ID: <201001041903.21755.rui.p.m.sousa@gmail.com> (raw)
In-Reply-To: <4B3CE8DE.4020701@netfilter.org>
On Thursday 31 December 2009 19:09:34 Pablo Neira Ayuso wrote:
> Hi,
Hi Pablo,
> Rui Sousa wrote:
> > Hi all,
> >
> > Under some conditions it's possible to send a conntrack netlink event to
> > userspace which is missing the TCP connection state
> > (CDA_PROTOINFO_TCP_STATE) even though it is well defined.
> > This one liner should fix the problem. What do you think?
>
> I see, I had to look at the code to find the condition that you mention,
> that it is the following:
>
> if (!test_bit(IPS_ASSURED_BIT, &ct->status)
> && (old_state == TCP_CONNTRACK_SYN_RECV
>
> || old_state == TCP_CONNTRACK_ESTABLISHED)
>
> && new_state == TCP_CONNTRACK_ESTABLISHED)
> /* Set ASSURED if we see see valid ack in ESTABLISHED
> after SYN_RECV or a valid answer for a picked up
> connection. */
I believe so, but I having a hard time understanding what I'm seeing.
AFAICT, I'm exercising the state transition sNo->sES->sES, my procedure is:
PC1 -> linux router -> PC2
1. establish TCP connection between two PC's (using iperf). PC1 is the client,
PC2 is the server.
2. On the router, ifdown of output interface (the interface on PC2 side)
3. On the router, manual destroy of connection in kernel
4. On the router, ifup of output interface
5. wait for iperf to start sending packets again. The connection between the
endpoints is always established.
Between 3 and 4 I receive a NFCT_DESTROY event (from libnetfilter_conntrack).
During 5. I get two events, both NFCT_UPDATEs, the first with conntrack status
CONFIRMED/SEEN_REPLY, the second with conntrack status ASSURED. Both are
missing the TCP protoinfo. In this is my problem, the kernel correctly picked
up the on going TCP connection but never sends enough information to
userspace about it.
> However, the policy is to include the TCP protocol state iff it has
> changed.
But in my case it does change and I never get a protocol state indication.
Br,
Rui
next prev parent reply other threads:[~2010-01-04 18:03 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-31 13:03 [PATCH] conntrack event missing TCP protoinfo Rui Sousa
2009-12-31 18:09 ` Pablo Neira Ayuso
2010-01-04 18:03 ` Rui Sousa [this message]
2010-01-05 19:19 ` Pablo Neira Ayuso
2010-01-05 20:39 ` Pablo Neira Ayuso
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=201001041903.21755.rui.p.m.sousa@gmail.com \
--to=rui.p.m.sousa@gmail.com \
--cc=netfilter-devel@vger.kernel.org \
--cc=pablo@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).