From: Hannes Eder <heder@google.com>
To: lvs-devel@vger.kernel.org
Cc: netdev@vger.kernel.org, netfilter-devel@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: [RFC][PATCH 4/5] IPVS: debugging output for ip_vs_update_conntrack
Date: Mon, 27 Jul 2009 15:46:31 +0200 [thread overview]
Message-ID: <20090727134631.12897.59167.stgit@jazzy.zrh.corp.google.com> (raw)
In-Reply-To: <20090727134457.12897.272.stgit@jazzy.zrh.corp.google.com>
This patch is not ment to be merged, its mere for debugging during
development.
Signed-off-by: Hannes Eder <heder@google.com>
net/netfilter/ipvs/ip_vs_xmit.c | 26 ++++++++++++++++++++++++++
1 files changed, 26 insertions(+), 0 deletions(-)
diff --git a/net/netfilter/ipvs/ip_vs_xmit.c b/net/netfilter/ipvs/ip_vs_xmit.c
index f3b6810..ed6b811 100644
--- a/net/netfilter/ipvs/ip_vs_xmit.c
+++ b/net/netfilter/ipvs/ip_vs_xmit.c
@@ -24,6 +24,7 @@
#include <net/ip6_route.h>
#include <linux/icmpv6.h>
#include <linux/netfilter.h>
+#define DEBUG
#include <net/netfilter/nf_conntrack.h>
#include <linux/netfilter_ipv4.h>
@@ -345,12 +346,31 @@ ip_vs_bypass_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp,
}
#endif
+#ifdef DEBUG
+static void
+ip_vs_dump_ct_tuple(const struct nf_conntrack_tuple *t)
+{
+ /*
+ * We ignore the fact that this is not SMP-safe. Otherwise we would
+ * have to duplicate code and this code is not ment to stay here anyway.
+ */
+ printk(KERN_DEBUG "IPVS: ");
+ nf_ct_dump_tuple(t);
+}
+#endif
+
static void
ip_vs_update_conntrack(struct sk_buff *skb, struct ip_vs_conn *cp)
{
if (skb->nfct) {
struct nf_conn *ct = (struct nf_conn *)skb->nfct;
+#ifdef DEBUG
+ ip_vs_dump_ct_tuple(&ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple);
+ ip_vs_dump_ct_tuple(&ct->tuplehash[IP_CT_DIR_REPLY].tuple);
+ printk("IPVS: nfct confirmed=%d\n", nf_ct_is_confirmed(ct));
+#endif
+
if (ct != &nf_conntrack_untracked && !nf_ct_is_confirmed(ct)) {
/*
* The connection is not yet in the hashtable, so we
@@ -365,6 +385,12 @@ ip_vs_update_conntrack(struct sk_buff *skb, struct ip_vs_conn *cp)
ct->tuplehash[IP_CT_DIR_REPLY].tuple.src.u.tcp.port =
cp->dport;
}
+
+#ifdef DEBUG
+ ip_vs_dump_ct_tuple(&ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple);
+ ip_vs_dump_ct_tuple(&ct->tuplehash[IP_CT_DIR_REPLY].tuple);
+#endif
+
}
}
next prev parent reply other threads:[~2009-07-27 15:32 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-27 13:46 [RFC][PATCH 0/5] IPVS full NAT support + netfilter 'ipvs' match support Hannes Eder
2009-07-27 13:46 ` [RFC][PATCH 1/5] IPVS: prefix EnterFunction and LeaveFunction msg with "IPVS:" Hannes Eder
2009-07-27 18:14 ` Jan Engelhardt
2009-07-28 11:15 ` Hannes Eder
2009-07-27 13:46 ` [RFC][PATCH 2/5] netfilter: xt_ipvs (netfilter matcher for ipvs) Hannes Eder
2009-07-27 18:35 ` Jan Engelhardt
2009-07-28 14:55 ` Hannes Eder
2009-07-27 13:46 ` [RFC][PATCH 3/5] IPVS: make friends with nf_conntrack Hannes Eder
2009-07-27 13:46 ` Hannes Eder [this message]
2009-07-27 13:48 ` [RFC][PATCH 5/5] libxt_ipvs: user space lib for netfilter matcher xt_ipvs Hannes Eder
2009-07-27 18:40 ` Jan Engelhardt
2009-07-28 12:34 ` Hannes Eder
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=20090727134631.12897.59167.stgit@jazzy.zrh.corp.google.com \
--to=heder@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lvs-devel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=netfilter-devel@vger.kernel.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
all inboxes | Powered by JetHome®