Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3463320pxb; Mon, 24 Jan 2022 10:04:37 -0800 (PST) X-Google-Smtp-Source: ABdhPJxn/U79XxSfuhCMVKT+Nt/V37uThwnRhlNaf/Z7Aaz6D4EMXeYphUKiNJl5Ak4eo5QQ+lGD X-Received: by 2002:a17:90b:1d11:: with SMTP id on17mr2978935pjb.167.1643047477529; Mon, 24 Jan 2022 10:04:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643047477; cv=none; d=google.com; s=arc-20160816; b=Z1MPOZUcOfl6kswsnHhPV+Z4+X0pjSVO4Hjz9fDhW9fR0hVGO3tR4xTo7z6KTlz5Bw d6QJfQOzlm6p+P3vRiULImrwgoRvO//U4w0dJsYUuM/EepxK8VwLN1RSDrGWEDmmCcbE fA3AJEJiXOE/5w4C6x2Tq/XQxUzXXYzUpsx6q9ZHsRQpmBIH6HXk40Z0WOIwjOvzsc0w e4nOi32nbqWSEpfPn9nJRdlmGWT1764KzQyFKp9KHULaugKvGhC0z8zgh5VALjkw/pSl Ymnw7r3XLDSnIAmBqvlgOs7zQ1tJJmuNRfPE1BapWMAbD3RIYqzO8SP+VZPNsAui79vH Ha0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=nD5obR63VkP6WVi1Qvqgq55SISF4MGH71shBHQiK3HQ=; b=Z1DAAeMhX/3KcKaX8b9bByz27yvdqtDtoZbsbIErGlYY45fqwgusdOhEh4zWf54m41 1Ow64EcO4chx2PogVWbg6J8MZaGcDJncUf308+9kxOshUPofqLs9RF7Ezi0t30F52ndo ZuTTwzMoOPUIGkDBnbuGLX+SK1aID1Al4r+q2GBV/pYb7epXLOzBZmYBZ/TnedgFrOBz ZXJQFh5C5/2G8WgVZD8tGULQfcHcz/Z9Sqa145tIVSWLMFjf8OZ1d8ctAacRIBkz2nVv B/bILsLfIzQspQq+uxOHDOGW9E4HYodMuowZ5hzMgyQQ2G4wTgWHiIjccitng5v0gFYW G0Gw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f13si3053143plg.303.2022.01.24.10.04.23; Mon, 24 Jan 2022 10:04:37 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241766AbiAXHVf (ORCPT + 99 others); Mon, 24 Jan 2022 02:21:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50288 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235807AbiAXHVe (ORCPT ); Mon, 24 Jan 2022 02:21:34 -0500 Received: from Chamillionaire.breakpoint.cc (Chamillionaire.breakpoint.cc [IPv6:2a0a:51c0:0:12e:520::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BB70AC06173B; Sun, 23 Jan 2022 23:21:34 -0800 (PST) Received: from fw by Chamillionaire.breakpoint.cc with local (Exim 4.92) (envelope-from ) id 1nBtf5-0004hl-3j; Mon, 24 Jan 2022 08:21:11 +0100 Date: Mon, 24 Jan 2022 08:21:11 +0100 From: Florian Westphal To: kai zhang 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 Message-ID: <20220124072111.GB14018@breakpoint.cc> References: <20220124053455.55858-1-zhangkaiheb@126.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220124053455.55858-1-zhangkaiheb@126.com> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org kai zhang 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.