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: Sun, 3 Dec 2017 07:39:04 +0100 Message-ID: <20171203063903.GA1903@nanopsycho> References: <20171130225335.6957-1-xiyou.wangcong@gmail.com> <20171202085739.GE1821@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-f170.google.com ([209.85.128.170]:38806 "EHLO mail-wr0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751790AbdLCGjH (ORCPT ); Sun, 3 Dec 2017 01:39:07 -0500 Received: by mail-wr0-f170.google.com with SMTP id o2so13941852wro.5 for ; Sat, 02 Dec 2017 22:39:06 -0800 (PST) Content-Disposition: inline In-Reply-To: Sender: netdev-owner@vger.kernel.org List-ID: Sat, Dec 02, 2017 at 08:53:20PM CET, xiyou.wangcong@gmail.com wrote: >On Sat, Dec 2, 2017 at 11:47 AM, Cong Wang wrote: >> On Sat, Dec 2, 2017 at 12:57 AM, Jiri Pirko wrote: >>> Good. Please also use m->tcfm_dev->ifindex in tcf_mirred_dump and >>> tcf_mirred_ifindex. Then you can remove tcfm_ifindex completely. >> >> Sounds good. Will send v2. > >Hold on, m->tcfm_dev could be NULL, so we can't just def it here. > >I think we can just use 0 when it is NULL: > >.ifindex = m->tcfm_dev ? m->tcfm_dev->ifindex : 0, > >This also "fixes" the garbage ifindex dump when the target device is gone. Sounds fine.