netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: pablo@netfilter.org
Cc: netdev@vger.kernel.org, davem@davemloft.net,
	netfilter-devel@vger.kernel.org
Subject: Re: [PATCH 7/7] netfilter: nf_ct_helper: better logging for dropped packets
Date: Mon, 18 Feb 2013 16:22:02 -0800	[thread overview]
Message-ID: <1361233322.2046.3.camel@joe-AO722> (raw)
In-Reply-To: <1361232651-5626-8-git-send-email-pablo@netfilter.org>

On Tue, 2013-02-19 at 01:10 +0100, pablo@netfilter.org wrote:
> This patch modifies the existing code to provide more specific
> error message in the scope of each helper to help users to debug
> the reason why the packet has been dropped, ie:
[]
> diff --git a/include/net/netfilter/nf_conntrack_helper.h b/include/net/netfilter/nf_conntrack_helper.h
[]
> @@ -100,6 +100,9 @@ struct nf_ct_helper_expectfn {
>  	void (*expectfn)(struct nf_conn *ct, struct nf_conntrack_expect *exp);
>  };
>  
> +extern void nf_ct_helper_log(struct sk_buff *skb, const struct nf_conn *,
> +			     const char *fmt, ...);

this should be declared

__printf(3, 4)
void nf_ct_helper_log(etc...)

to get the compiler to verify format and arguments.

> @@ -210,8 +212,11 @@ static int help(struct sk_buff *skb, unsigned int protoff,
>  						 addr_beg_p - ib_ptr,
>  						 addr_end_p - addr_beg_p,
>  						 exp);
> -			else if (nf_ct_expect_related(exp) != 0)
> +			else if (nf_ct_expect_related(exp) != 0) {
> +				nf_ct_helper_log(skb, ct, "cannot add "
> +							  "expectation");

do please try to avoid splitting formats

				nf_ct_helper_log(skb, ct,
						 "cannot add expectation");

> @@ -1123,8 +1130,11 @@ static int process_sdp(struct sk_buff *skb, unsigned int protoff,
>  					      dptr, datalen, mediaoff,
>  					      SDP_HDR_CONNECTION, SDP_HDR_MEDIA,
>  					      &rtp_addr);
> -			if (ret != NF_ACCEPT)
> +			if (ret != NF_ACCEPT) {
> +				nf_ct_helper_log(skb, ct, "cannot mangle "
> +							  "media connection");

here too, etc...



  reply	other threads:[~2013-02-19  0:22 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-19  0:10 [PATCH 0/7] netfilter updates for net-next pablo
2013-02-19  0:10 ` [PATCH 1/7] netfilter: fix missing dependencies for NETFILTER_XT_MATCH_CONNLABEL pablo
2013-02-19  0:10 ` [PATCH 2/7] netfilter: xt_conntrack: Add flag to support aliases pablo
2013-02-19  0:10 ` [PATCH 3/7] netfilter: xt_CT: merge common code of revision 0 and 1 pablo
2013-02-19  0:10 ` [PATCH 4/7] netfilter: xt_CT: add alias flag pablo
2013-02-19  0:10 ` [PATCH 5/7] netfilter: nfnetlink: add mutex per subsystem pablo
2013-02-19  0:10 ` [PATCH 6/7] netfilter: nf_ct_pptp: Fix comment referring to incorrect RFC pablo
2013-02-19  0:10 ` [PATCH 7/7] netfilter: nf_ct_helper: better logging for dropped packets pablo
2013-02-19  0:22   ` Joe Perches [this message]
2013-02-19  1:11     ` Pablo Neira Ayuso
2013-02-19  1:23       ` Joe Perches
2013-02-19  1:43         ` Pablo Neira Ayuso
2013-02-19  1:33       ` Joe Perches
2013-02-19  1:50         ` Pablo Neira Ayuso
2013-02-19  7:51           ` [PATCH 7/7] netfilter: nf_ct_helper: Fix " Joe Perches
2013-02-19 20:17             ` Pablo Neira Ayuso
2013-02-19  5:44 ` [PATCH 0/7] netfilter updates for net-next David Miller

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=1361233322.2046.3.camel@joe-AO722 \
    --to=joe@perches.com \
    --cc=davem@davemloft.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;
as well as URLs for NNTP newsgroup(s).