Re: [Patch net-next] act_mirred: use tcfm_dev in tcf_mirred_get_dev()
From: Cong Wang <hidden>
Date: 2017-12-02 19:53:41
From: Cong Wang <hidden>
Date: 2017-12-02 19:53:41
On Sat, Dec 2, 2017 at 11:47 AM, Cong Wang [off-list ref] wrote:
On Sat, Dec 2, 2017 at 12:57 AM, Jiri Pirko [off-list ref] wrote:quoted
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.