[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1361233322.2046.3.camel@joe-AO722>
Date: Mon, 18 Feb 2013 16:22:02 -0800
From: Joe Perches <joe@...ches.com>
To: pablo@...filter.org
Cc: netdev@...r.kernel.org, davem@...emloft.net,
netfilter-devel@...r.kernel.org
Subject: Re: [PATCH 7/7] netfilter: nf_ct_helper: better logging for dropped
packets
On Tue, 2013-02-19 at 01:10 +0100, pablo@...filter.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...
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists