Re: [B.A.T.M.A.N.] [PATCH v3 6/6] batman-adv: debugfs: Add netns support

Andrew Lunn
2016-03-14T14:06:24Z

> Matthias is against applying [1] patch 6 because it would require that
> batman-adv supports this interface for a long(tm) time. He proposes to use
> netlink instead.
>
> Andrew, do you want to change patch 6 to avoid creating the debugfs stuff in
> non-init_net netns?

I'm not sure how well that is going to work, from the user space side
of things.

In the kernel, we know if we are in init_net, or some other netns.

In user space, it is not so simple. Ideally, when in some other netns
than the default, we need all reads/writes to debugfs to fail. What we
don't want is it seeing the default name spaces files, because it is
going to get very confusing. These files refer to something which does
not exist in the current netns.

The problem is, how do we find out if we are in a different netns than
default?

Andrew