[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAOftzPg_xWLTp4S4p2cGJ3kdK7E50d-dzdmu26DTOBse6vd72Q@mail.gmail.com>
Date: Fri, 30 Nov 2018 15:18:25 -0800
From: Joe Stringer <joe@...d.net.nz>
To: Alexei Starovoitov <alexei.starovoitov@...il.com>
Cc: Joe Stringer <joe@...d.net.nz>, daniel@...earbox.net,
ast@...nel.org, netdev <netdev@...r.kernel.org>,
David Ahern <dsahern@...il.com>,
Nicolas Dichtel <nicolas.dichtel@...nd.com>
Subject: Re: [PATCHv2 bpf 1/2] bpf: Support sk lookup in netns with id 0
On Fri, 30 Nov 2018 at 14:42, Alexei Starovoitov
<alexei.starovoitov@...il.com> wrote:
>
> On Thu, Nov 29, 2018 at 04:29:33PM -0800, Joe Stringer wrote:
> > David Ahern and Nicolas Dichtel report that the handling of the netns id
> > 0 is incorrect for the BPF socket lookup helpers: rather than finding
> > the netns with id 0, it is resolving to the current netns. This renders
> > the netns_id 0 inaccessible.
> >
> > To fix this, adjust the API for the netns to treat all negative s32
> > values as a lookup in the current netns, while any values with a
> > positive value in the signed 32-bit integer space would result in a
> > lookup for a socket in the netns corresponding to that id. As before, if
> > the netns with that ID does not exist, no socket will be found.
> > Furthermore, if any bits are set in the upper 32-bits, then no socket
> > will be found.
> >
> > Signed-off-by: Joe Stringer <joe@...d.net.nz>
> ..
> > +/* Current network namespace */
> > +#define BPF_CURRENT_NETNS (-1L)
>
> I was about to apply it, but then noticed that the name doesn't match
> the rest of the names.
> Could you rename it to BPF_F_CURRENT_NETNS ?
I skipped the F_ part since it's not really a flag, it's a value. I
can put it back though.
> Also reword the commit log so it's less misleading.
Can do.
Cheers,
Joe
Powered by blists - more mailing lists