lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y26B8NL3Rv2u/otG@lunn.ch>
Date:   Fri, 11 Nov 2022 18:10:08 +0100
From:   Andrew Lunn <andrew@...n.ch>
To:     Rasmus Villemoes <linux@...musvillemoes.dk>
Cc:     Vivien Didelot <vivien.didelot@...il.com>,
        Florian Fainelli <f.fainelli@...il.com>,
        Vladimir Oltean <olteanv@...il.com>,
        "David S. Miller" <davem@...emloft.net>,
        Eric Dumazet <edumazet@...gle.com>,
        Jakub Kicinski <kuba@...nel.org>,
        Paolo Abeni <pabeni@...hat.com>, netdev@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] net: dsa: use NET_NAME_PREDICTABLE for user ports with
 name given in DT

> diff --git a/net/dsa/slave.c b/net/dsa/slave.c
> index a9fde48cffd4..dfefcc4a9ccf 100644
> --- a/net/dsa/slave.c
> +++ b/net/dsa/slave.c
> @@ -2374,16 +2374,25 @@ int dsa_slave_create(struct dsa_port *port)
>  {
>  	struct net_device *master = dsa_port_to_master(port);
>  	struct dsa_switch *ds = port->ds;
> -	const char *name = port->name;
>  	struct net_device *slave_dev;
>  	struct dsa_slave_priv *p;
> +	const char *name;
> +	int assign_type;
>  	int ret;
>  
>  	if (!ds->num_tx_queues)
>  		ds->num_tx_queues = 1;
>  
> +	if (port->name) {
> +		name = port->name;
> +		assign_type = NET_NAME_PREDICTABLE;
> +	} else {
> +		name = "eth%d";
> +		assign_type = NET_NAME_UNKNOWN;
> +	}

I know it is a change in behaviour, but it seems like NET_NAME_ENUM
should be used, not NET_NAME_UNKNOWN. alloc_etherdev_mqs() uses
NET_NAME_ENUM.

https://elixir.bootlin.com/linux/latest/source/include/uapi/linux/netdevice.h#L42
says that NET_NAME_UNKNOWN does not get passed to user space, but i
assume NET_NAME_ENUM does. So maybe changing it would be an ABI
change?

Humm, i don't know what the right thing is...

      Andrew

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ