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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240705180016.64085ea5@kernel.org>
Date: Fri, 5 Jul 2024 18:00:16 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: Oleksij Rempel <o.rempel@...gutronix.de>
Cc: Michal Kubecek <mkubecek@...e.cz>, "David S. Miller"
 <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>, Paolo Abeni
 <pabeni@...hat.com>, Jiri Pirko <jiri@...nulli.us>, Vladimir Oltean
 <vladimir.oltean@....com>, Andrew Lunn <andrew@...n.ch>, Arun Ramadoss
 <arun.ramadoss@...rochip.com>, Woojung.Huh@...rochip.com,
 kernel@...gutronix.de, netdev@...r.kernel.org,
 UNGLinuxDriver@...rochip.com, linux-kernel@...r.kernel.org
Subject: Re: [PATCH net v1 1/1] ethtool: netlink: do not return SQI value if
 link is down

On Thu,  4 Jul 2024 07:40:07 +0200 Oleksij Rempel wrote:
>  	if (!phydev->drv || !phydev->drv->get_sqi)
>  		ret = -EOPNOTSUPP;
> +	else if (!phydev->link)
> +		ret = -ENETDOWN;

Can we stick to EOPNOTSUPP for the link down case as well?
We're consuming the error, the exact value doesn't matter.
Or let's add a helper which checks the int sqi in all it's
incarnations for validity:

static bool linkstate_sqi_no_data(int sqi)
{
	return sqi == -EOPNOTSUPP || sqi == -ENETDOWN;
}

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ