[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <59C995AD.8090001@iogearbox.net>
Date: Tue, 26 Sep 2017 01:47:57 +0200
From: Daniel Borkmann <daniel@...earbox.net>
To: Cong Wang <xiyou.wangcong@...il.com>
CC: Linux Kernel Network Developers <netdev@...r.kernel.org>,
Chris Mi <chrism@...lanox.com>,
Jamal Hadi Salim <jhs@...atatu.com>
Subject: Re: [Patch net-next v2] net_sched: use idr to allocate bpf filter
handles
On 09/26/2017 01:11 AM, Cong Wang wrote:
> On Mon, Sep 25, 2017 at 2:16 PM, Daniel Borkmann <daniel@...earbox.net> wrote:
>> On 09/25/2017 07:13 PM, Cong Wang wrote:
[...]
>> There's this condition in the code before above idr allocations,
>> I think also in other classifiers:
>>
>> if (oldprog) {
>> if (handle && oldprog->handle != handle) {
>> ret = -EINVAL;
>> goto errout;
>> }
>> }
>
> Sure. If we use handle to find oldprog, it should have the
> same handle. cls_bpf_get() guarantees it. This check is
> redundant.
Good point, we should just test for 'oldprog && oldprog->handle !=
handle' and bail out then, otherwise it's just irritating. I can
see to fix this up later. Seems fine to me then, thanks!
Powered by blists - more mailing lists