Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp987009rdd; Wed, 10 Jan 2024 05:36:34 -0800 (PST) X-Google-Smtp-Source: AGHT+IEnE3Xa08dNAEStu+lK/jZ6tOerR36/pyBJHvdTeoQI3KK/ngat9je5e4eYG+Fn2JQzuvbW X-Received: by 2002:a05:6a20:a10f:b0:19a:3122:ff69 with SMTP id q15-20020a056a20a10f00b0019a3122ff69mr361086pzk.66.1704893794460; Wed, 10 Jan 2024 05:36:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704893794; cv=none; d=google.com; s=arc-20160816; b=JsivhmiRzDUTiPYVwPRaAq1wivaI7fEF1HXe3xAWQdN3/dQtl9aKrVWavoh2gLgFxW UzdkyKCh8k+8yADKabgQniz1NPpu7D461o+PxWno7BsR1bHnYyhop3sX048kRQ0+jbQ3 HL7+h4dvvuYjH1g7LREcBKzw4xbV6UR7awJBIReAI70TWQubOu9bp0AtmKsJad6QHUHg AFMt86QEEkP+bYe7Jznnt2bJP3Los/JHXtqkeGk3yY274RlXebDC8+e4zvUDpRk1Ip9f pBJRw+5iGotbOfZe5414yNsqsiIM/T+dj9JK0D8LAWPX7Eb1E/TGvXn5u8ykePCptYzb vY4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=user-agent:in-reply-to:content-disposition:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :message-id:subject:cc:to:from:date; bh=ehPLtNQ071tLu+djRUZAd1o4TbGRb4MATCwXXk4YczY=; fh=pVndnr1q6+1GnZ0kFBithe0kxLo/4E5xpF3YUcf4OFM=; b=MHziazBYDfFqqmyHFksN4T9Fc0NA9oLMMe5jMh5UM7NOZA5wPQXPYK/A1EVFFK+yK7 MGfK4fQgnqWg+nWWXa8m/m/uAhXS7WLfcTzHah07lcOEQh2x6V0GQGm4o790k0/JX+dU Ocy7tb6YIxYdgk3ayMydQEhZjaIJBVNn5freZUi1x5tkJZjBkYavfR79Ubc9H5uqYfkt XkEhJOU3up52Bw2BfxliCz90YCVrWhRSiUmBfdBocFTUQL/YnX9t3nQ8t1qxEk1WHlMS J5S92mGYdqos5XWaGQn2IT7ZI0aoL+FVzb3UatOH2H2BjvYsD909xTo1cRp28vGJ5Up8 CtTA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-22249-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-22249-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id a10-20020a17090a8c0a00b0028db9dc6563si1364556pjo.110.2024.01.10.05.36.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Jan 2024 05:36:34 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-22249-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-22249-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-22249-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 29EEC280D8C for ; Wed, 10 Jan 2024 13:36:34 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 762714A997; Wed, 10 Jan 2024 13:33:47 +0000 (UTC) Received: from Chamillionaire.breakpoint.cc (Chamillionaire.breakpoint.cc [91.216.245.30]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AE9FE4CB5B; Wed, 10 Jan 2024 13:33:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=strlen.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=strlen.de Received: from fw by Chamillionaire.breakpoint.cc with local (Exim 4.92) (envelope-from ) id 1rNYi5-0000Y9-0c; Wed, 10 Jan 2024 14:33:33 +0100 Date: Wed, 10 Jan 2024 14:33:33 +0100 From: Florian Westphal To: Pavel Tikhomirov Cc: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Florian Westphal , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@openvz.org Subject: Re: [PATCH 1/4] netfilter: nfnetlink_log: use proper helper for fetching physinif Message-ID: <20240110133333.GA24888@breakpoint.cc> References: <20240110110451.5473-1-ptikhomirov@virtuozzo.com> <20240110110451.5473-2-ptikhomirov@virtuozzo.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240110110451.5473-2-ptikhomirov@virtuozzo.com> User-Agent: Mutt/1.10.1 (2018-07-13) Pavel Tikhomirov wrote: > We don't use physindev in __build_packet_message except for getting > physinif from it. So let's switch to nf_bridge_get_physinif to get what > we want directly. > > Signed-off-by: Pavel Tikhomirov > --- > net/netfilter/nfnetlink_log.c | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/net/netfilter/nfnetlink_log.c b/net/netfilter/nfnetlink_log.c > index f03f4d4d7d889..134e05d31061e 100644 > --- a/net/netfilter/nfnetlink_log.c > +++ b/net/netfilter/nfnetlink_log.c > @@ -508,7 +508,7 @@ __build_packet_message(struct nfnl_log_net *log, > htonl(br_port_get_rcu(indev)->br->dev->ifindex))) > goto nla_put_failure; > } else { > - struct net_device *physindev; > + int physinif; > > /* Case 2: indev is bridge group, we need to look for > * physical device (when called from ipv4) */ > @@ -516,10 +516,10 @@ __build_packet_message(struct nfnl_log_net *log, > htonl(indev->ifindex))) > goto nla_put_failure; > > - physindev = nf_bridge_get_physindev(skb); > - if (physindev && > + physinif = nf_bridge_get_physinif(skb); > + if (physinif && > nla_put_be32(inst->skb, NFULA_IFINDEX_PHYSINDEV, > - htonl(physindev->ifindex))) > + htonl(physinif))) I think you can drop this patch and make the last patch pass nf_bridge_info->physinif directly.