Subject: Re: [RFC PATCH 2/5] can: slcan: remove legacy infrastructure

From: Marc Kleine-Budde <[email-masked]>
Date: Tue, 19 Jul 2022 21:59:27 +0200

On 19.07.2022 03:03:26, Max Staudt wrote:
> On Mon, 18 Jul 2022 12:23:05 +0200
> Oliver Hartkopp <[email-masked]> wrote:
> 
> > IMO it does not break user space when slcan gets the common naming 
> > schema for CAN interface names.
> 
> For what it's worth, slcan provides a specific ioctl to resolve from
> (tty fd) to (netdev name). As far as I can see, any sane program should
> use this API to find whatever device it has created, irrespective of
> the netdev name.
> 
> 
> @ Marc: slcand and slcan_attach in can-utils do not depend on the
> slcanX name, as far as I can see. They are the main interfaces to
> slcan, and apart from that I can only think of scripts doing netlink
> stuff and scanning for slcanX. Does this change your opinion, or is
> breaking such scripts already a step too far?
> 
> I'm thinking that in other circumstances, I've had cases where devices
> were numbered differently just because they enumerated faster or slower
> at different boots, or with other kernel versions, or because of media
> inserted, etc. - though renumbering is of course one step less than
> changing the prefix.

Convinced! Please change the patch to use standard canX interface
naming. Can you add a pointer to the ioctl() to get the network
interface name to the tty fd in the patch description.

> > We had the same thing with 'eth0' which is now named enblablabla or 
> > 'wlan0' now named wlp2s0.
> 
> Actually, the kernel still calls them ethX and wlanX. It's systemd+udev
> that renames them to the "unique" names afterwards. It's an extra step
> that happens in userspace.
> 
> udev is immensely useful, but also great stuff for race conditions :)

Marc

-- 
Pengutronix e.K.                 | Marc Kleine-Budde           |
Embedded Linux                   | https://www.pengutronix.de  |
Vertretung West/Dortmund         | Phone: +49-231-2826-924     |
Amtsgericht Hildesheim, HRA 2686 | Fax:   +49-5121-206917-5555 |