From: Eric Dumazet <eric.dumazet@gmail.com>
To: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: Netfilter Development Mailinglist
<netfilter-devel@vger.kernel.org>,
netdev <netdev@vger.kernel.org>,
Patrick McHardy <kaber@trash.net>
Subject: [PATCH] netfilter: ipt_CLUSTERIP: dont flood with "no conntrack!"
Date: Thu, 13 Jan 2011 12:13:29 +0100 [thread overview]
Message-ID: <1294917210.3570.48.camel@edumazet-laptop> (raw)
In-Reply-To: <4D2E1A74.5080102@netfilter.org>
ipt_CLUSTERIP users might hit this annoying printk, if they forgot an
"iptables -I INPUT -m state --state INVALID -j DROP" before CLUSTERIP
rule. We could use net_ratelimit() here, or not log the message at all.
I chose to log it once per config.
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
CC: Patrick McHardy <kaber@trash.net>
---
net/ipv4/netfilter/ipt_CLUSTERIP.c | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/net/ipv4/netfilter/ipt_CLUSTERIP.c b/net/ipv4/netfilter/ipt_CLUSTERIP.c
index 1e26a48..bac8739 100644
--- a/net/ipv4/netfilter/ipt_CLUSTERIP.c
+++ b/net/ipv4/netfilter/ipt_CLUSTERIP.c
@@ -47,6 +47,7 @@ struct clusterip_config {
u_int8_t clustermac[ETH_ALEN]; /* the MAC address */
struct net_device *dev; /* device */
u_int16_t num_total_nodes; /* total number of nodes */
+ bool warned_no_conntrack;
unsigned long local_nodes; /* node number array */
#ifdef CONFIG_PROC_FS
@@ -301,10 +302,14 @@ clusterip_tg(struct sk_buff *skb, const struct xt_action_param *par)
ct = nf_ct_get(skb, &ctinfo);
if (ct == NULL) {
- pr_info("no conntrack!\n");
- /* FIXME: need to drop invalid ones, since replies
- * to outgoing connections of other nodes will be
- * marked as INVALID */
+ if (unlikely(!cipinfo->config->warned_no_conntrack)) {
+ cipinfo->config->warned_no_conntrack = true;
+ pr_info("no conntrack!\n");
+ }
+ /* FIXME: need to drop invalid ones, since replies
+ * to outgoing connections of other nodes will be
+ * marked as INVALID
+ */
return NF_DROP;
}
next parent reply other threads:[~2011-01-13 11:13 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <4D2E1A74.5080102@netfilter.org>
2011-01-13 11:13 ` Eric Dumazet [this message]
2011-01-13 11:23 ` [PATCH] netfilter: ipt_CLUSTERIP: dont flood with "no conntrack!" Pablo Neira Ayuso
2011-01-13 11:28 ` Patrick McHardy
2011-01-13 11:29 ` Pablo Neira Ayuso
2011-01-13 11:36 ` Eric Dumazet
2011-01-13 11:32 ` Eric Dumazet
2011-01-13 11:54 ` Pablo Neira Ayuso
2011-01-13 13:38 ` [PATCH v4] netfilter: ipt_CLUSTERIP: remove " Eric Dumazet
2011-01-13 14:02 ` Jan Engelhardt
2011-01-13 14:39 ` Eric Dumazet
2011-01-13 16:30 ` Pablo Neira Ayuso
2011-01-13 16:35 ` Pablo Neira Ayuso
2011-01-13 16:48 ` Eric Dumazet
2011-01-18 15:28 ` Patrick McHardy
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=1294917210.3570.48.camel@edumazet-laptop \
--to=eric.dumazet@gmail.com \
--cc=kaber@trash.net \
--cc=netdev@vger.kernel.org \
--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