[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <55CE3B11.40406@iogearbox.net>
Date: Fri, 14 Aug 2015 21:01:37 +0200
From: Daniel Borkmann <daniel@...earbox.net>
To: Willem de Bruijn <willemb@...gle.com>
CC: Alexei Starovoitov <ast@...mgrid.com>, netdev@...r.kernel.org,
davem@...emloft.net, edumazet@...gle.com
Subject: Re: [PATCH net-next 2/4] packet: add eBPF fanout mode
[ @Willem: RH email doesn't exist anymore, I took it out, otherwise
every reply gets a bounce. ;) ]
On 08/14/2015 07:03 PM, Alexei Starovoitov wrote:
> On 8/14/15 8:50 AM, Willem de Bruijn wrote:
...
> all looks great except in the above the check:
> if (new->type != BPF_PROG_TYPE_SOCKET_FILTER) {
> bpf_prog_put(new);
> return -EINVAL;
> }
> is missing. Otherwise user will be able to attach programs
> of wrong types to fanout.
>
> Also instead of:
> #define PACKET_FANOUT_BPF 6
> #define PACKET_FANOUT_EBPF 7
>
> I would call them FANOUT_CBPF and FANOUT_EBPF to be unambiguous.
> This is how bpf manpage distinguishes them.
We have SO_ATTACH_FILTER and SO_ATTACH_BPF, could also be
analogous for fanout, if we want to be consistent with the API?
But C/E prefix seems okay too, how you want ...
Btw, in case someone sets sock_flag(sk, SOCK_FILTER_LOCKED),
perhaps we should also apply it on fanout?
Thanks,
Daniel
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists