netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Florian Westphal <fw@strlen.de>
To: kai zhang <zhangkaiheb@126.com>
Cc: pablo@netfilter.org, kadlec@netfilter.org, fw@strlen.de,
	davem@davemloft.net, yoshfuji@linux-ipv6.org, dsahern@kernel.org,
	kuba@kernel.org, netfilter-devel@vger.kernel.org,
	coreteam@netfilter.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] net: fix duplicate logs of iptables TRACE target
Date: Mon, 24 Jan 2022 08:21:11 +0100	[thread overview]
Message-ID: <20220124072111.GB14018@breakpoint.cc> (raw)
In-Reply-To: <20220124053455.55858-1-zhangkaiheb@126.com>

kai zhang <zhangkaiheb@126.com> wrote:
> Below configuration, mangle,filter and security tables have no rule:
> 
> There are 5 logs for incoming ssh packet:
> 
> kernel: [ 7018.727278] TRACE: raw:PREROUTING:policy:2 IN=enp9s0 ...
> kernel: [ 7018.727304] TRACE: mangle:PREROUTING:policy:1 IN=enp9s0 ...
> kernel: [ 7018.727327] TRACE: mangle:INPUT:policy:1 IN=enp9s0 ...
> kernel: [ 7018.727343] TRACE: filter:INPUT:policy:1 IN=enp9s0 ...
> kernel: [ 7018.727359] TRACE: security:INPUT:policy:1 IN=enp9s0 ...

Thats correct and exactly whats supposed to happen.

>  #if IS_ENABLED(CONFIG_NETFILTER_XT_TARGET_TRACE)
>  		/* The packet is traced: log it */
> -		if (unlikely(skb->nf_trace))
> +		if (unlikely(skb->nf_trace)) {
>  			trace_packet(state->net, skb, hook, state->in,
>  				     state->out, table->name, private, e);
> +			nf_reset_trace(skb);
> +		}

This breaks the long established behavior of TRACE,
we don't want users to have to TRACE tables individually which may also
be hard when nat is involved.

  reply	other threads:[~2022-01-24  7:21 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-24  5:34 [PATCH] net: fix duplicate logs of iptables TRACE target kai zhang
2022-01-24  7:21 ` Florian Westphal [this message]
  -- strict thread matches above, loose matches on Subject: below --
2022-01-24  5:37 kai zhang
2022-01-24 11:54 ` Pablo Neira Ayuso

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=20220124072111.GB14018@breakpoint.cc \
    --to=fw@strlen.de \
    --cc=coreteam@netfilter.org \
    --cc=davem@davemloft.net \
    --cc=dsahern@kernel.org \
    --cc=kadlec@netfilter.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=pablo@netfilter.org \
    --cc=yoshfuji@linux-ipv6.org \
    --cc=zhangkaiheb@126.com \
    /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).