From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jiri Pirko Subject: Re: [Patch net-next] act_mirred: use tcfm_dev in tcf_mirred_get_dev() Date: Sat, 2 Dec 2017 07:56:34 +0100 Message-ID: <20171202065634.GA1821@nanopsycho> References: <20171130225335.6957-1-xiyou.wangcong@gmail.com> <20171201175619.GC2396@nanopsycho> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Linux Kernel Network Developers , Jiri Pirko , Jamal Hadi Salim To: Cong Wang Return-path: Received: from mail-wr0-f195.google.com ([209.85.128.195]:46009 "EHLO mail-wr0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751367AbdLBG4h (ORCPT ); Sat, 2 Dec 2017 01:56:37 -0500 Received: by mail-wr0-f195.google.com with SMTP id h1so12146933wre.12 for ; Fri, 01 Dec 2017 22:56:37 -0800 (PST) Content-Disposition: inline In-Reply-To: Sender: netdev-owner@vger.kernel.org List-ID: Fri, Dec 01, 2017 at 10:46:42PM CET, xiyou.wangcong@gmail.com wrote: >On Fri, Dec 1, 2017 at 9:56 AM, Jiri Pirko wrote: >> >> Isn't this here so user may specify a ifindex of netdev which is not yet >> present on the system (not sure how much sense that would make though...) > >How is this even possible? If an ifindex is not present, we return ENODEV: Right, I missed this. Thanks. > > if (parm->ifindex) { > dev = __dev_get_by_index(net, parm->ifindex); > if (dev == NULL) { > if (exists) > tcf_idr_release(*a, bind); > return -ENODEV; > }