Thread (5 messages) flat view 5 messages, 3 authors, 2017-09-28

Re: [Patch net-next v2] net_sched: use idr to allocate bpf filter handles

From: Daniel Borkmann <daniel@iogearbox.net>
Date: 2017-09-25 23:48:00

On 09/26/2017 01:11 AM, Cong Wang wrote:
On Mon, Sep 25, 2017 at 2:16 PM, Daniel Borkmann [off-list ref] wrote:
quoted
On 09/25/2017 07:13 PM, Cong Wang wrote:
[...]
quoted
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!
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help