From: Christoph Paasch <christoph.paasch@gmail.com>
To: Eric Leblond <eric@inl.fr>
Cc: netfilter-devel@vger.kernel.org, yasuyuki.kozakai@toshiba.co.jp,
kaber@trash.net
Subject: Re: [PATCH] netfilter: don't track ICMPv6 negotiation message.
Date: Mon, 9 Feb 2009 18:39:28 +0100 [thread overview]
Message-ID: <200902091839.29175.christoph.paasch@gmail.com> (raw)
In-Reply-To: <498F17EA.1030907@inl.fr>
Hi,
thanks for your reply.
On Sun February 8 2009, Eric Leblond wrote:
> Hi,
>
> Christoph Paasch a écrit :
> > Why do you set skb->nfctinfo = IP_CT_NEW?
> > Because in xt_state.c, at state_mt(...) :
> > if it is in front of an untracked packet (using nf_ct_is_untracked(skb))
> > it automatically sets the statebit to UNTRACKED and so the IP_CT_NEW
> > isn't used.
>
> Not much to say on that point. I wanted to be homogeneous with what is
> done in xt_NOTRACK.c.
OK.
But then I'm asking me, why does the UNTRACKED state isn't documented in the
iptables manpage, even if this one exists for the iptables state module? As
those ICMPv6 messages will be recognized as UNTRACKED by xt_state.c, and so
the firewall administrator needs to allow those kind of packets.
But well, this is more an issue of the iptables manpage, ...
>
> > Why do you return NF_ACCEPT and not -NF_ACCEPT?
> > By returning a positiv value, the packet will continue it's way through
> > the connection tracker.
>
> If I understand well, icmpv6_error will be called in nf_conntrack_core.c
> as l4proto->error :
>
> if (l4proto->error != NULL) {
> ret = l4proto->error(net, skb, dataoff, &ctinfo, pf, hooknum);
> if (ret <= 0) {
> NF_CT_STAT_INC_ATOMIC(net, error);
> NF_CT_STAT_INC_ATOMIC(net, invalid);
> return -ret;
> }
> }
>
> It will thus increment error counters if return is -NF_ACCEPT. As the
> packets we deal with are not error I don't think it is correct to return
> -NF_ACCEPT.
>
> But I agree with the fact, that returning NF_ACCEPT leads to some
> useless work inside the kernel.
The packet will then go up to the call to icmpv6_new (as the connection
tracker will still look for a connection matching the tuple):
if (type < 0 || type >= sizeof(valid_new) || !valid_new[type]) {
/* Can't create a new ICMPv6 `conn' with this. */
pr_debug("icmpv6: can't create new conn with type %u\n",
type + 128);
nf_ct_dump_tuple_ipv6(&ct->tuplehash[0].tuple);
return false;
}
And then the invalid counter will get incremented in nf_conntrack_in(...):
ct = resolve_normal_ct(net, skb, dataoff, pf, protonum,
l3proto, l4proto, &set_reply, &ctinfo);
if (!ct) {
/* Not valid part of a connection */
NF_CT_STAT_INC_ATOMIC(net, invalid);
return NF_ACCEPT;
}
So, maybe the handling of the ICMPv6 negotiation messages should get moved to
icmpv6_new, with a more descriptive pr_debug message than the one who is
present.
--
Christoph Paasch
www.rollerbulls.be
--
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2009-02-09 17:39 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <200901271007.n0RA78k6023294@toshiba.co.jp>
2009-01-27 10:55 ` [PATCH] netfilter: don't track ICMPv6 negotiation message Eric Leblond
2009-01-27 14:57 ` Patrick McHardy
2009-02-06 10:30 ` Christoph Paasch
2009-02-08 17:35 ` Eric Leblond
2009-02-09 17:39 ` Christoph Paasch [this message]
2009-01-23 11:10 [PATCH 0/2] IPv6 conntrack support for neighbour discovery Yasuyuki KOZAKAI
2009-01-24 10:32 ` [PATCH] netfilter: don't track ICMPv6 negotiation message Eric Leblond
2009-01-27 10:07 ` Yasuyuki KOZAKAI
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=200902091839.29175.christoph.paasch@gmail.com \
--to=christoph.paasch@gmail.com \
--cc=eric@inl.fr \
--cc=kaber@trash.net \
--cc=netfilter-devel@vger.kernel.org \
--cc=yasuyuki.kozakai@toshiba.co.jp \
/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).