From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Netfilter Development Mailinglist <netfilter-devel@lists.netfilter.org>
Cc: Patrick McHardy <kaber@trash.net>
Subject: [PATCH 6/10][CTNETLINK] dump counters iif connection ended or counters filled up
Date: Fri, 07 Jul 2006 04:15:25 +0200 [thread overview]
Message-ID: <44ADC3BD.3050609@netfilter.org> (raw)
[-- Attachment #1: Type: text/plain, Size: 691 bytes --]
This patch makes ctnetlink to dump counters iif connection reaches the
destroy state or altenatively if counters filled up.
AFAICS counters on NEW and UPDATE events doesn't provide interesting
information, they just consume the limited netlink bandwidth.
Upcoming conntrackd release in statistics mode uses counters from
DESTROY events to keep the contability of traffic that the firewall has
processed.
I think that this patch should also reset counters upon fill up event,
comments?
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
--
The dawn of the fourth age of Linux firewalling is coming; a time of
great struggle and heroic deeds -- J.Kadlecsik got inspired by J.Morris
[-- Attachment #2: 06counters.patch --]
[-- Type: text/plain, Size: 1995 bytes --]
[CTNETLINK] dump counters iif connection ended or counters filled up
This patch makes ctnetlink to dump counters iif connection reaches the
destroy state or altenatively if counters filled up.
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Index: net-2.6/net/ipv4/netfilter/ip_conntrack_netlink.c
===================================================================
--- net-2.6.orig/net/ipv4/netfilter/ip_conntrack_netlink.c 2006-07-06 19:52:54.000000000 +0200
+++ net-2.6/net/ipv4/netfilter/ip_conntrack_netlink.c 2006-07-06 19:54:00.000000000 +0200
@@ -381,8 +381,10 @@ static int ctnetlink_conntrack_event(str
&& ctnetlink_dump_helpinfo(skb, ct) < 0)
goto nfattr_failure;
- if (ctnetlink_dump_counters(skb, ct, IP_CT_DIR_ORIGINAL) < 0 ||
- ctnetlink_dump_counters(skb, ct, IP_CT_DIR_REPLY) < 0)
+ /* this connection has died or counters wrapped around */
+ if ((events & IPCT_DESTROY || events & IPCT_COUNTER_FILLING)
+ && (ctnetlink_dump_counters(skb, ct, IP_CT_DIR_ORIGINAL) < 0 ||
+ ctnetlink_dump_counters(skb, ct, IP_CT_DIR_REPLY) < 0))
goto nfattr_failure;
if (events & IPCT_MARK
Index: net-2.6/net/netfilter/nf_conntrack_netlink.c
===================================================================
--- net-2.6.orig/net/netfilter/nf_conntrack_netlink.c 2006-07-06 19:54:02.000000000 +0200
+++ net-2.6/net/netfilter/nf_conntrack_netlink.c 2006-07-06 19:54:35.000000000 +0200
@@ -391,8 +391,10 @@ static int ctnetlink_conntrack_event(str
&& ctnetlink_dump_helpinfo(skb, ct) < 0)
goto nfattr_failure;
- if (ctnetlink_dump_counters(skb, ct, IP_CT_DIR_ORIGINAL) < 0 ||
- ctnetlink_dump_counters(skb, ct, IP_CT_DIR_REPLY) < 0)
+ /* this connection has died or counters wrapped around */
+ if ((events & IPCT_DESTROY || events & IPCT_COUNTER_FILLING)
+ && (ctnetlink_dump_counters(skb, ct, IP_CT_DIR_ORIGINAL) < 0 ||
+ ctnetlink_dump_counters(skb, ct, IP_CT_DIR_REPLY) < 0))
goto nfattr_failure;
if (events & IPCT_MARK
next reply other threads:[~2006-07-07 2:15 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-07-07 2:15 Pablo Neira Ayuso [this message]
2006-07-07 4:48 ` [PATCH 6/10][CTNETLINK] dump counters iif connection ended or counters filled up Patrick McHardy
2006-07-07 8:25 ` Amin Azez
2006-07-07 13:51 ` Pablo Neira Ayuso
2006-07-07 16:03 ` Amin Azez
2006-07-10 4:47 ` Patrick McHardy
2006-07-13 20:09 ` Pablo Neira Ayuso
2006-07-14 9:43 ` Patrick McHardy
2006-07-07 8:18 ` 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=44ADC3BD.3050609@netfilter.org \
--to=pablo@netfilter.org \
--cc=kaber@trash.net \
--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.