Web lists-archives.com

Re: Naming of network devices - how to improve it in buster




On Wed, Jul 12, 2017 at 07:16:16PM -0300, Henrique de Moraes Holschuh wrote:

> > Indeed, the best solution would be to never rename the interfaces and
> > simply create aliases / symlinks. Then again, I'm no kernel hacker so I
> > have no idea if that would be feasible.
> 
> ip link set dev eth0 alias foo0

This is not doing anything useful. A link "alias" is merely a free-form
string that you can put a more descriptive informative name in, which is
simply completely ignored in the kernel. So after the above command,
something like "ip link set dev foo0 up" just gives the error "Cannot
find device foo0".

> The obvious thing would be to just tell the kernel to change namespaces
> in the first place (kconfig + command line), and have userspace aware of
> the kernel namespace using sysfs.  Just beware the kernel default would
> be "unspecified" (and not "eth*", etc) because this is not central
> policy in the kernel at all).  I have never understood why this wasn't
> done, since it is absolutely trivial to implement, even if it is a lot
> of busywork (you have to patch each !@#$ network driver).  But you could
> clean up a _LOT_ of crap kernel side while at it, AND create both a
> central point for naming this stuff AND better device grouping, so it
> would be worth the trouble.  And it would be opt-in, default N, and
> detectable from userspace, so that it would not regress anything not
> prepared for it.

That sounds interesting!

-- 
Met vriendelijke groet / with kind regards,
      Guus Sliepen <guus@xxxxxxxxxx>

Attachment: signature.asc
Description: PGP signature