From patchwork Fri Apr 10 14:26:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 11483343 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6AF1D14B4 for ; Fri, 10 Apr 2020 14:27:13 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 481052082D for ; Fri, 10 Apr 2020 14:27:13 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="KKVq2EnM" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 481052082D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-m68k.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=t1o21Ql2zNS5+lzehPsgFzuSXq4vteTR+ltlxOvFpNc=; b=KKVq2EnMDhHxsv Q+k3n4NpDcG1NJuttkuzPmN+xZGDjX6x9nmiq/pMKtkr4FYOCFIAIkJ/kwGKrmpfezah+1lnOjTmu wdDI7WxASF0/Zr7/DiaoWfq8TGS1KrDA/KnzvunLRiyO0H8Hav5ZB4+q/bo9hWDOjKn6CrMcmwi6I RshD73A4pau+2UyA6eoo1VEnojGFt40pYbWa2BgAfAoEiw6j6F3kJ1bexJ57eXum+lU/gHyXn2Uly P/n5hfajvG+CAGARaIiqRscOruhoMEWEO/SzncC/wiywnJ1tOBIvhQwqwIjjuajcdt6IwNttsQL8X dLRhwvuNO/HZEdqXvnKw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jMuch-0007ry-Cb; Fri, 10 Apr 2020 14:27:11 +0000 Received: from albert.telenet-ops.be ([2a02:1800:110:4::f00:1a]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jMuce-0007qy-Uh for linux-mediatek@lists.infradead.org; Fri, 10 Apr 2020 14:27:10 +0000 Received: from ramsan ([84.195.182.253]) by albert.telenet-ops.be with bizsmtp id R2Sq2200B5USYZQ062SqQ2; Fri, 10 Apr 2020 16:26:58 +0200 Received: from rox.of.borg ([192.168.97.57]) by ramsan with esmtp (Exim 4.90_1) (envelope-from ) id 1jMucM-0004qD-Ci; Fri, 10 Apr 2020 16:26:50 +0200 Received: from geert by rox.of.borg with local (Exim 4.90_1) (envelope-from ) id 1jMucM-0004qj-9Q; Fri, 10 Apr 2020 16:26:50 +0200 From: Geert Uytterhoeven To: Joerg Roedel , Krzysztof Kozlowski , Matthias Brugger Subject: [PATCH] netfilter: nft_fwd_netdev: Fix CONFIG_NET_CLS_ACT=n build Date: Fri, 10 Apr 2020 16:26:48 +0200 Message-Id: <20200410142648.18599-1-geert@linux-m68k.org> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200410_072709_126532_1BE4E4CC X-CRM114-Status: UNSURE ( 7.47 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.7 (/) X-Spam-Report: SpamAssassin version 3.4.4 on bombadil.infradead.org summary: Content analysis details: (-0.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [2a02:1800:110:4:0:0:f00:1a listed in] [list.dnswl.org] 0.0 SPF_NONE SPF: sender does not publish an SPF Record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Geert Uytterhoeven , iommu@lists.linux-foundation.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org If CONFIG_NET_CLS_ACT=n: net/netfilter/nft_fwd_netdev.c: In function ‘nft_fwd_netdev_eval’: net/netfilter/nft_fwd_netdev.c:32:10: error: ‘struct sk_buff’ has no member named ‘tc_redirected’ pkt->skb->tc_redirected = 1; ^~ net/netfilter/nft_fwd_netdev.c:33:10: error: ‘struct sk_buff’ has no member named ‘tc_from_ingress’ pkt->skb->tc_from_ingress = 1; ^~ Fix this by protecting this code hunk with the appropriate #ifdef. Reported-by: noreply@ellerman.id.au Fixes: bcfabee1afd99484 ("netfilter: nft_fwd_netdev: allow to redirect to ifb via ingress") Signed-off-by: Geert Uytterhoeven --- net/netfilter/nft_fwd_netdev.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net/netfilter/nft_fwd_netdev.c b/net/netfilter/nft_fwd_netdev.c index 74f050ba6badc9dc..ebcaf5c325712f30 100644 --- a/net/netfilter/nft_fwd_netdev.c +++ b/net/netfilter/nft_fwd_netdev.c @@ -28,9 +28,11 @@ static void nft_fwd_netdev_eval(const struct nft_expr *expr, struct nft_fwd_netdev *priv = nft_expr_priv(expr); int oif = regs->data[priv->sreg_dev]; +#ifdef CONFIG_NET_CLS_ACT /* These are used by ifb only. */ pkt->skb->tc_redirected = 1; pkt->skb->tc_from_ingress = 1; +#endif nf_fwd_netdev_egress(pkt, oif); regs->verdict.code = NF_STOLEN;