From: Shan Wei <shanwei@cn.fujitsu.com>
To: David Miller <davem@davemloft.net>,
Patrick McHardy <kaber@trash.net>,
Yasuyuki KOZAKAI <yasuyuki.kozakai@toshiba.co.jp>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
netfilter-devel@vger.kernel.org,
Shan Wei <shanwei@cn.fujitsu.com>
Subject: [RFC PATCH net-next 3/5]IPv6:netfilter: Record MIB counter when reassembling all fragments
Date: Wed, 24 Feb 2010 14:08:26 +0800 [thread overview]
Message-ID: <4B84C25A.4080403@cn.fujitsu.com> (raw)
According to RFC4293, this patch records MIB counter of IPSTATS_MIB_REASMFAILS,
IPSTATS_MIB_REASMOKS, when reassembling fragments after all fragments reached.
Signed-off-by: Shan Wei <shanwei@cn.fujitsu.com>
---
net/ipv6/netfilter/nf_conntrack_reasm.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/net/ipv6/netfilter/nf_conntrack_reasm.c b/net/ipv6/netfilter/nf_conntrack_reasm.c
index 4a1b5bd..9f50c13 100644
--- a/net/ipv6/netfilter/nf_conntrack_reasm.c
+++ b/net/ipv6/netfilter/nf_conntrack_reasm.c
@@ -398,6 +398,7 @@ static struct sk_buff *
nf_ct_frag6_reasm(struct nf_ct_frag6_queue *fq, struct net_device *dev)
{
struct sk_buff *fp, *op, *head = fq->q.fragments;
+ struct net *net = container_of(fq->q.net, struct net, ipv6.frags);
int payload_len;
fq_kill(fq);
@@ -499,6 +500,9 @@ nf_ct_frag6_reasm(struct nf_ct_frag6_queue *fq, struct net_device *dev)
NFCT_FRAG6_CB(fp)->orig = NULL;
}
+ rcu_read_lock();
+ IP6_INC_STATS(net, __in6_dev_get(dev), IPSTATS_MIB_REASMOKS);
+ rcu_read_unlock();
return head;
out_oversize:
@@ -509,6 +513,9 @@ out_oom:
if (net_ratelimit())
printk(KERN_DEBUG "nf_ct_frag6_reasm: no memory for reassembly\n");
out_fail:
+ rcu_read_lock();
+ IP6_INC_STATS(net, __in6_dev_get(dev), IPSTATS_MIB_REASMFAILS);
+ rcu_read_unlock();
return NULL;
}
--
1.6.3.3
reply other threads:[~2010-02-24 6:08 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=4B84C25A.4080403@cn.fujitsu.com \
--to=shanwei@cn.fujitsu.com \
--cc=davem@davemloft.net \
--cc=kaber@trash.net \
--cc=netdev@vger.kernel.org \
--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).