From patchwork Mon Jul 27 13:46:31 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hannes Eder X-Patchwork-Id: 30271 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@bilbo.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from ozlabs.org (ozlabs.org [203.10.76.45]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mx.ozlabs.org", Issuer "CA Cert Signing Authority" (verified OK)) by bilbo.ozlabs.org (Postfix) with ESMTPS id D2A31B6F1E for ; Tue, 28 Jul 2009 01:33:24 +1000 (EST) Received: by ozlabs.org (Postfix) id C73A3DDD0B; Tue, 28 Jul 2009 01:33:24 +1000 (EST) Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by ozlabs.org (Postfix) with ESMTP id 5AB05DDD04 for ; Tue, 28 Jul 2009 01:33:24 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752988AbZG0PcE (ORCPT ); Mon, 27 Jul 2009 11:32:04 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752755AbZG0PbZ (ORCPT ); Mon, 27 Jul 2009 11:31:25 -0400 Received: from smtp-out.google.com ([216.239.45.13]:16449 "EHLO smtp-out.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752616AbZG0PbV (ORCPT ); Mon, 27 Jul 2009 11:31:21 -0400 Received: from spaceape24.eur.corp.google.com (spaceape24.eur.corp.google.com [172.28.16.76]) by smtp-out.google.com with ESMTP id n6RFVKdK003946; Mon, 27 Jul 2009 08:31:20 -0700 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=google.com; s=beta; t=1248708681; bh=3aksLeP2PbbyWbGaNh24z/VoYM8=; h=DomainKey-Signature:Subject:To:From:Cc:Date:Message-ID: In-Reply-To:References:User-Agent:MIME-Version:Content-Type: Content-Transfer-Encoding:X-System-Of-Record; b=QLrlnfr3oeu4Fz6y2p qRr5p82qq1qW51nYUjNXEEznayltbcQH1CQOo3zfhy2GIRybZ9HEtXJB/Rp2coFMqG2 g== DomainKey-Signature: a=rsa-sha1; s=beta; d=google.com; c=nofws; q=dns; h=subject:to:from:cc:date:message-id:in-reply-to:references: user-agent:mime-version:content-type: content-transfer-encoding:x-system-of-record; b=aU420+IKP8437RLlPhdp2Uq243y6zVZf5HAtDYqFGIghsCpjVuhpN/aDysC/xL5jz WjB+pcNH9a89S78MzxgZg== Received: from localhost (jazzy.zrh.corp.google.com [172.16.74.150]) by spaceape24.eur.corp.google.com with ESMTP id n6RFVGl6003591; Mon, 27 Jul 2009 08:31:17 -0700 Received: by localhost (Postfix, from userid 95149) id CF1ABEA6B9; Mon, 27 Jul 2009 17:31:16 +0200 (CEST) Subject: [RFC][PATCH 4/5] IPVS: debugging output for ip_vs_update_conntrack To: lvs-devel@vger.kernel.org From: Hannes Eder Cc: netdev@vger.kernel.org, netfilter-devel@vger.kernel.org, linux-kernel@vger.kernel.org Date: Mon, 27 Jul 2009 15:46:31 +0200 Message-ID: <20090727134631.12897.59167.stgit@jazzy.zrh.corp.google.com> In-Reply-To: <20090727134457.12897.272.stgit@jazzy.zrh.corp.google.com> References: <20090727134457.12897.272.stgit@jazzy.zrh.corp.google.com> User-Agent: StGit/0.14.3.366.gf979 MIME-Version: 1.0 X-System-Of-Record: true Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org This patch is not ment to be merged, its mere for debugging during development. Signed-off-by: Hannes Eder net/netfilter/ipvs/ip_vs_xmit.c | 26 ++++++++++++++++++++++++++ 1 files changed, 26 insertions(+), 0 deletions(-) --- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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 #include #include +#define DEBUG #include #include @@ -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 + } }