Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp31417imw; Tue, 12 Jul 2022 14:03:56 -0700 (PDT) X-Google-Smtp-Source: AGRyM1scPP4EX8aH4339X0dtRhT+cV1T1zjXxyDE4GQzP8S5Q7PZshZTWW9aP7bP4VINoI0iD+dz X-Received: by 2002:a17:903:18b:b0:16c:4026:610 with SMTP id z11-20020a170903018b00b0016c40260610mr165793plg.122.1657659836309; Tue, 12 Jul 2022 14:03:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657659836; cv=none; d=google.com; s=arc-20160816; b=lfllG9QXQBTxanMAIu4nwUpbFO3x+tGJip2YdYFeu08b5RV/6W7ta1sACT0FqFdM0C JhW+YwYRU92qgQI1vGCBWq2qtK0ZuAwUtEMSnx8VJOuAnH+vUJ958KRF0+i0XoxB2iJr KdGoSIQIch6TiXCute8ncmKASFn3+NJJSosTwBmw42MaOykAwAKrsMd1KlRZn6V8lcqx aj2LxnSeAeBLehGh83Q/0MJ2yZ3TwR3OSllLvOQO3FMwkSCkR7eQO+CU6xXtF2mENgJR ZoiJvcyVNSDR4QsPM1PubLXcXlD6Wahx4ubpMVan2z6czHr/9JpFqFNxPsXXzvRCSjsB RXAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=b72alVckcPzZXzPWnEZYO93LPht+qX1JAJRyl2iLreU=; b=hU6490FxvluL1WYn5/yMUNV8gfpBOLTIKLFawVXey8+G8jzAU5ekvq4Do93hw+EOI8 ef3UxPa90PI0tLrv8BjvjxCpvAaK7n1MQtPxSjwd5aVTtnIjEM6+3MrWUZ3W77FqkEi4 xKWIrk1mdiRCWg+v318E3J8rEkr6UmOh6minkUcLBtnU+wDEW1RCOORhU64hCKHr3rLc WCulGqELEolYk5V/lv/k6O5KcRJDbxDjj4+ve6sBZ+tXORPlk+jrPgdMnIOmWGwN4W0Q JBC54KYtXeMjoJ1mQMvXiBG0G0bqbKbYPSqRN6+bQQdMnctoN/S7OTvjnAS9SQHOBcQR LzUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=mKNHNl0M; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z1-20020a170903018100b0015eabaaa16fsi17985963plg.578.2022.07.12.14.03.42; Tue, 12 Jul 2022 14:03:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=mKNHNl0M; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232819AbiGLUj1 (ORCPT + 99 others); Tue, 12 Jul 2022 16:39:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43180 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233027AbiGLUjM (ORCPT ); Tue, 12 Jul 2022 16:39:12 -0400 Received: from mail-ej1-x633.google.com (mail-ej1-x633.google.com [IPv6:2a00:1450:4864:20::633]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2B548FD13 for ; Tue, 12 Jul 2022 13:39:10 -0700 (PDT) Received: by mail-ej1-x633.google.com with SMTP id ss3so10371160ejc.11 for ; Tue, 12 Jul 2022 13:39:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=b72alVckcPzZXzPWnEZYO93LPht+qX1JAJRyl2iLreU=; b=mKNHNl0MhdwN9VNUIsAeqMYqtN6x7jo+bgZDJ8Tpie4yosu6XpL9u//7HTijR8y1vG i2kASpeTvce2Wa/lgJctYYxTQnBK2NHPAYELGKpaUy86poX4Na6fr2pSUYk1TMpvWcbb yVxnGkV6/W4sXlR+bT3tj73cPouI7+c9NTh7eYKysF0iDACIl/jGdQbHh/2g0b0bNle3 fGS04LI/ZrbQSdvz3LyOi/q7N/8lZrJX6+/gPUuTxHJS3l3a+6ntF24oAAjxTjwsHpOM soHCKTpG9SfhYUQ7hM1FlXsB/H+J9Dyq7Z9wzGgI6ODre7121pHvIigNUUk+EEvGVa7K r1Fw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=b72alVckcPzZXzPWnEZYO93LPht+qX1JAJRyl2iLreU=; b=qTlYvUBe6pf44il2bTrttcBz2vamVfdF28L+GTSYJl2QYHdVoeEX0NfA/EJz2yXj9A kLVs4DLGOKXAUzXmpb1riN+YR+iEz/3NdEscKQkAe9xxKN2sORsfvSm6BD+PTK7lKM1z R/RVDlE3OtRlkz8/uA0q7hQvCucakVMYW4eEYAPIQa5HEaP1cIqPDkzuqFJpDVNwJSi1 E5LRxuCt7hNVDsmO11LD5Zowix2Sm3b1Qxq84HMtQCxERdrKO03dKBUI6pgQI1W2jrE+ 1j6rx5Ueh4kxLBYnfDHtpe1FiF3WveiuycMO1qoMskNdJKYHQZ9I0AfGtfn4CQLh5hef f+gg== X-Gm-Message-State: AJIora+G5wex3hYO01bs0ov16JSf2NqkCAbrfHRYZK10yJaim4QB2De0 OttyXDh31g+3PlrERp0GLtr3Luw3GjOT0/fa+PAZaQ== X-Received: by 2002:a17:906:5a67:b0:72b:610d:4aa4 with SMTP id my39-20020a1709065a6700b0072b610d4aa4mr10225902ejc.294.1657658348687; Tue, 12 Jul 2022 13:39:08 -0700 (PDT) MIME-Version: 1.0 References: <20220712183452.2949361-1-justinstitt@google.com> In-Reply-To: From: Justin Stitt Date: Tue, 12 Jul 2022 13:38:57 -0700 Message-ID: Subject: Re: [PATCH] netfilter: xt_TPROXY: remove pr_debug invocations To: Nathan Chancellor Cc: pablo@netfilter.org, coreteam@netfilter.org, davem@davemloft.net, edumazet@google.com, fw@strlen.de, kadlec@netfilter.org, kuba@kernel.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev, ndesaulniers@google.com, netdev@vger.kernel.org, netfilter-devel@vger.kernel.org, pabeni@redhat.com, trix@redhat.com Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 12, 2022 at 11:56 AM Nathan Chancellor wrote: > > Hi Justin, > > On Tue, Jul 12, 2022 at 11:34:52AM -0700, Justin Stitt wrote: > > pr_debug calls are no longer needed in this file. > > > > Pablo suggested "a patch to remove these pr_debug calls". This patch has > > some other beneficial collateral as it also silences multiple Clang > > -Wformat warnings that were present in the pr_debug calls. > > > > Suggested-by: Pablo Neira Ayuso > > Signed-off-by: Justin Stitt > > Thanks for the patch! > > Reviewed-by: Nathan Chancellor > > Couple of style comments below that probably warrant a v2, you can carry > the above tag forward for future revisions. No need to give me a > "Suggested-by". > > > --- > > Suggestion here: https://lore.kernel.org/all/Ys0zZACWwGilTwHx@salvia/ > > > > net/netfilter/xt_TPROXY.c | 19 ------------------- > > 1 file changed, 19 deletions(-) > > > > diff --git a/net/netfilter/xt_TPROXY.c b/net/netfilter/xt_TPROXY.c > > index 459d0696c91a..dc7284e6357b 100644 > > --- a/net/netfilter/xt_TPROXY.c > > +++ b/net/netfilter/xt_TPROXY.c > > @@ -74,18 +74,10 @@ tproxy_tg4(struct net *net, struct sk_buff *skb, __be32 laddr, __be16 lport, > > /* This should be in a separate target, but we don't do multiple > > targets on the same rule yet */ > > skb->mark = (skb->mark & ~mark_mask) ^ mark_value; > > - > > - pr_debug("redirecting: proto %hhu %pI4:%hu -> %pI4:%hu, mark: %x\n", > > - iph->protocol, &iph->daddr, ntohs(hp->dest), > > - &laddr, ntohs(lport), skb->mark); > > - > > nf_tproxy_assign_sock(skb, sk); > > return NF_ACCEPT; > > } > > > > - pr_debug("no socket, dropping: proto %hhu %pI4:%hu -> %pI4:%hu, mark: %x\n", > > - iph->protocol, &iph->saddr, ntohs(hp->source), > > - &iph->daddr, ntohs(hp->dest), skb->mark); > > return NF_DROP; > > } > > > > @@ -123,13 +115,11 @@ tproxy_tg6_v1(struct sk_buff *skb, const struct xt_action_param *par) > > > > tproto = ipv6_find_hdr(skb, &thoff, -1, NULL, NULL); > > if (tproto < 0) { > > checkpatch.pl should have warned that these if statement braces here and > below are no longer necessary because there is only one statement within > them now. Weirdly, checkpatch.pl gave 0 warnings regarding this patch. At any rate, v2 is coming shortly. Thanks for the review! > > if (tproto < 0) > return NF_DROP; > > I believe it is important to do these types of style cleanups when doing > a larger change so that people do not try to do them as standalone > changes, which can irritate maintainers. > > > - pr_debug("unable to find transport header in IPv6 packet, dropping\n"); > > return NF_DROP; > > } > > > > hp = skb_header_pointer(skb, thoff, sizeof(_hdr), &_hdr); > > if (hp == NULL) { > > - pr_debug("unable to grab transport header contents in IPv6 packet, dropping\n"); > > return NF_DROP; > > } > > if (hp == NULL) > return NF_DROP; > > could even go a step farther and make it > > if (!hp) > return NF_DROP; > > if there is a warning about that. > > > > > @@ -168,19 +158,10 @@ tproxy_tg6_v1(struct sk_buff *skb, const struct xt_action_param *par) > > /* This should be in a separate target, but we don't do multiple > > targets on the same rule yet */ > > skb->mark = (skb->mark & ~tgi->mark_mask) ^ tgi->mark_value; > > - > > - pr_debug("redirecting: proto %hhu %pI6:%hu -> %pI6:%hu, mark: %x\n", > > - tproto, &iph->saddr, ntohs(hp->source), > > - laddr, ntohs(lport), skb->mark); > > - > > nf_tproxy_assign_sock(skb, sk); > > return NF_ACCEPT; > > } > > > > - pr_debug("no socket, dropping: proto %hhu %pI6:%hu -> %pI6:%hu, mark: %x\n", > > - tproto, &iph->saddr, ntohs(hp->source), > > - &iph->daddr, ntohs(hp->dest), skb->mark); > > - > > return NF_DROP; > > } > > > > -- > > 2.37.0.144.g8ac04bfd2-goog > >