From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4275AC433DF for ; Thu, 4 Jun 2020 20:53:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1D202207D3 for ; Thu, 4 Jun 2020 20:53:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730174AbgFDUxy (ORCPT ); Thu, 4 Jun 2020 16:53:54 -0400 Received: from www62.your-server.de ([213.133.104.62]:45388 "EHLO www62.your-server.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729582AbgFDUxx (ORCPT ); Thu, 4 Jun 2020 16:53:53 -0400 Received: from sslproxy03.your-server.de ([88.198.220.132]) by www62.your-server.de with esmtpsa (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89_1) (envelope-from ) id 1jgwrq-0003cj-HJ; Thu, 04 Jun 2020 22:53:38 +0200 Received: from [178.196.57.75] (helo=pc-9.home) by sslproxy03.your-server.de with esmtpsa (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jgwrq-00093o-1k; Thu, 04 Jun 2020 22:53:38 +0200 Subject: Re: [PATCH bpf v2] bpf: fix unused-var without NETDEVICES To: Song Liu , Matthieu Baerts Cc: Alexei Starovoitov , Andrii Nakryiko , Alexei Starovoitov , bpf , "David S . Miller" , fejes@inf.elte.hu, John Fastabend , Martin KaFai Lau , KP Singh , Jakub Kicinski , open list , Networking , Song Liu , Yonghong Song References: <20200603190347.2310320-1-matthieu.baerts@tessares.net> From: Daniel Borkmann Message-ID: <94837ee2-3dcc-41ef-e932-0c6d1285156d@iogearbox.net> Date: Thu, 4 Jun 2020 22:53:37 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Authenticated-Sender: daniel@iogearbox.net X-Virus-Scanned: Clear (ClamAV 0.102.2/25833/Thu Jun 4 14:45:29 2020) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 6/3/20 10:45 PM, Song Liu wrote: > On Wed, Jun 3, 2020 at 12:05 PM Matthieu Baerts > wrote: >> >> A recent commit added new variables only used if CONFIG_NETDEVICES is >> set. A simple fix would be to only declare these variables if the same >> condition is valid but Alexei suggested an even simpler solution: >> >> since CONFIG_NETDEVICES doesn't change anything in .h I think the >> best is to remove #ifdef CONFIG_NETDEVICES from net/core/filter.c >> and rely on sock_bindtoindex() returning ENOPROTOOPT in the extreme >> case of oddly configured kernels. >> >> Fixes: 70c58997c1e8 ("bpf: Allow SO_BINDTODEVICE opt in bpf_setsockopt") >> Suggested-by: Alexei Starovoitov >> Signed-off-by: Matthieu Baerts > > Acked-by: Song Liu Applied, thanks!