Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp1595028ybg; Thu, 4 Jun 2020 13:56:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx72mFNunkWJ6OLtgnJUgSgK+near6hgtFrrE0KI7uoFUHKlA2Kb/TemHEy8uf2Ep7NUHMT X-Received: by 2002:a17:906:6546:: with SMTP id u6mr5362750ejn.543.1591304200304; Thu, 04 Jun 2020 13:56:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591304200; cv=none; d=google.com; s=arc-20160816; b=j09QzTqvcM/xsoLCiY2HKzZ++1vhP5djyVPTfJJu+wKSqmnBKVoDIPEDKf91RX5Ik3 AWCoPAf/cQlO17RTivREiwzcsogfHUNzvLOZC2tR0J88NnCHE8nndl0ZLu0mKYRH8XlO tZ126tv6pE86HoIRlUoVBRW39lCipGey2HNfVFVSiiucZp7hGC/Ke4du0eNc4VYeCUFi sswxbB0C3nIvp2C6myMyNJRM5EN4+26DTSTu2rTCxAn3C08A5Ymt8c/revoX3dNIHLw7 Zlx8wzZ2Uwrxx/lhskkrLj1AhFbimPQau6WTJUBgHimxcXq24Z1MS3ect8omdNytTpaa jDmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=1QQQ4CYc1ObrA2NpGDChfWhb6KRYIkdvDTEsz/dKcik=; b=aOXGQnyz4HtHlMKQPDcco7hEJdD0dlhUXM8udwl81PCgGzxxK5493KjPGdQTfceNZM sMULMDozGhY4fLGVQgT40sJevH4f030uJwL8IHNaWT1SFp5FPu1JMQOCj6Txdta0p90b z2Zy6uG1qoQlul1/b1nTtQL0Ns9kAX5KbEFSLNS0yT2oResGahDU0wU017ZnIzcfY0ku GProbt4cjFpfqGVS3RBnHY30FTuRAG89867+6s2rWP6Smx7DheobNb7yp4jaPtWwC7C7 GG3bZ6XsFkrrU4o0KDKQeNmgqKr14Qy/iIunW+owW+V825oFZp2O1WdmYzODFVR/EuGe T+8g== 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 e6si2294862edr.358.2020.06.04.13.56.17; Thu, 04 Jun 2020 13:56:40 -0700 (PDT) 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 S1730117AbgFDUxy (ORCPT + 99 others); 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!