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: <d822d4c9-051d-4cc6-aee3-901e9c15c797@lunn.ch>
Date: Sun, 7 Jan 2024 17:28:47 +0100
From: Andrew Lunn <andrew@...n.ch>
To: Heiner Kallweit <hkallweit1@...il.com>
Cc: Russell King <rmk+kernel@...linux.org.uk>,
	Jakub Kicinski <kuba@...nel.org>,
	Eric Dumazet <edumazet@...gle.com>, Paolo Abeni <pabeni@...hat.com>,
	David Miller <davem@...emloft.net>,
	"netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: Re: [PATCH v2 RFC 2/5] ethtool: switch back from ethtool_keee to
 ethtool_eee for ioctl

> +static void eee_to_keee(struct ethtool_keee *keee,
> +			const struct ethtool_eee *eee)
> +{
> +	memset(keee, 0, sizeof(*keee));
> +
> +	keee->supported = eee->supported;
> +	keee->advertised = eee->advertised;
> +	keee->lp_advertised = eee->lp_advertised;
> +	keee->eee_active = eee->eee_active;
> +	keee->eee_enabled = eee->eee_enabled;
> +	keee->tx_lpi_enabled = eee->tx_lpi_enabled;
> +	keee->tx_lpi_timer = eee->tx_lpi_timer;

Just to avoid surprises, i would also copy keee->cmd to eee->cmd.

> +}
> +
> +static void keee_to_eee(struct ethtool_eee *eee,
> +			const struct ethtool_keee *keee)
> +{
> +	memset(eee, 0, sizeof(*eee));
> +
> +	eee->supported = keee->supported;
> +	eee->advertised = keee->advertised;
> +	eee->lp_advertised = keee->lp_advertised;
> +	eee->eee_active = keee->eee_active;
> +	eee->eee_enabled = keee->eee_enabled;
> +	eee->tx_lpi_enabled = keee->tx_lpi_enabled;
> +	eee->tx_lpi_timer = keee->tx_lpi_timer;

Same here.

Since reserved is not supposed to be used, not copying that is O.K.

	Andrew

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ