From: Masayuki Nakagawa <nakagawa.msy@ncos.nec.co.jp>
To: netdev@vger.kernel.org
Cc: davem@davemloft.net, yoshfuji@linux-ipv6.org,
Masayuki Nakagawa <nakagawa.msy@ncos.nec.co.jp>
Subject: [PATCH 2.6.23-rc1][NETFILTER] nf_conntrack_reasm: adding icmpv6_send code(TIME EXCEEDED).
Date: Wed, 01 Aug 2007 19:53:20 -0700 [thread overview]
Message-ID: <46B14720.9090300@ncos.nec.co.jp> (raw)
I ran the TAHI conformance test on a kernel, which CONFIG_NF_CONNTRACK_IPV6
is enabled. And then it showed a result including a couple of failure.
The all of failed items are related to TIME EXCEEDED.
The test procedure is here.
Tester Target
| |
|-------------------------->|
| Echo Request |
| (1st fragment) |
| |
| wait for 65 sec. |
| |
|<--------------------------|
| ICMPv6 Error |
(1) Tester sends a first fragment of ICMPv6 echo request to Target.
(2) Wait for over 60 sec.
(3) If target replies a ICMPv6 error message(Time Exceeded) to Tester,
then this test is success, otherwise it's failure.
The reason of the failure is very simple, it's because icmpv6_send code are
missing in nf_ct_frag6_expire function(nf_conntrack_reasm.c).
The change is to add the missing code.
In RFC2460, the specification regarding Time Exceeded is described,
but it's defined as "should". So, there is no specification violation here.
Therefore I'm not sure whether this change is appropriate or not.
I will appreciate any comments. Thanks.
Signed-off-by: Masayuki Nakagawa <nakagawa.msy@ncos.nec.co.jp>
Index: linux-2.6/net/ipv6/netfilter/nf_conntrack_reasm.c
===================================================================
--- linux-2.6.orig/net/ipv6/netfilter/nf_conntrack_reasm.c
+++ linux-2.6/net/ipv6/netfilter/nf_conntrack_reasm.c
@@ -76,6 +76,7 @@ struct nf_ct_frag6_queue
struct sk_buff *fragments;
int len;
int meat;
+ int iif;
ktime_t stamp;
unsigned int csum;
__u8 last_in; /* has first/last segment arrived? */
@@ -279,6 +280,7 @@ static void nf_ct_frag6_evictor(void)
static void nf_ct_frag6_expire(unsigned long data)
{
struct nf_ct_frag6_queue *fq = (struct nf_ct_frag6_queue *) data;
+ struct net_device *dev = NULL;
spin_lock(&fq->lock);
@@ -287,7 +289,26 @@ static void nf_ct_frag6_expire(unsigned
fq_kill(fq);
+ dev = dev_get_by_index(fq->iif);
+ if (!dev)
+ goto out;
+
+ /* Don't send error if the first segment did not arrive. */
+ if (!(fq->last_in&FIRST_IN) || !fq->fragments)
+ goto out;
+
+ /*
+ But use as source device on which LAST ARRIVED
+ segment was received. And do not use fq->dev
+ pointer directly, device might already disappeared.
+ */
+ fq->fragments->dev = dev;
+ icmpv6_send(fq->fragments, ICMPV6_TIME_EXCEED, ICMPV6_EXC_FRAGTIME, 0, dev);
+
out:
+ if (dev)
+ dev_put(dev);
+
spin_unlock(&fq->lock);
fq_put(fq, NULL);
}
@@ -534,6 +555,9 @@ static int nf_ct_frag6_queue(struct nf_c
else
fq->fragments = skb;
+ if (skb->dev)
+ fq->iif = skb->dev->ifindex;
+
skb->dev = NULL;
fq->stamp = skb->tstamp;
fq->meat += skb->len;
next reply other threads:[~2007-08-02 2:53 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-02 2:53 Masayuki Nakagawa [this message]
2007-08-02 4:26 ` [PATCH 2.6.23-rc1][NETFILTER] nf_conntrack_reasm: adding icmpv6_send code(TIME EXCEEDED) David Miller
2007-08-02 4:43 ` 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=46B14720.9090300@ncos.nec.co.jp \
--to=nakagawa.msy@ncos.nec.co.jp \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=yoshfuji@linux-ipv6.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).