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: <uzwfeeltnozvbdxigpu2mshrr7yjxgkbyrjeyfeavasue63cgn@w3ju2lpjq2ln>
Date: Mon, 4 Nov 2024 02:05:34 +0100
From: Michal Kubecek <mkubecek@...e.cz>
To: Mohan Prasad J <mohan.prasad@...rochip.com>
Cc: f.pfitzner@...gutronix.de, netdev@...r.kernel.org, 
	kory.maincent@...tlin.com, davem@...emloft.net, kuba@...nel.org, andrew@...n.ch, 
	Anbazhagan.Sakthivel@...rochip.com, Nisar.Sayed@...rochip.com
Subject: Re: [PATCH ethtool] netlink: settings: Fix for wrong
 auto-negotiation state

On Wed, Oct 16, 2024 at 09:28:47AM +0530, Mohan Prasad J wrote:
> Auto-negotiation state in json format showed the
> opposite state due to wrong comparison.
> Fix for returning the correct auto-neg state implemented.
> 
> Signed-off-by: Mohan Prasad J <mohan.prasad@...rochip.com>
> ---
>  netlink/settings.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/netlink/settings.c b/netlink/settings.c
> index dbfb520..a454bfb 100644
> --- a/netlink/settings.c
> +++ b/netlink/settings.c
> @@ -546,7 +546,7 @@ int linkmodes_reply_cb(const struct nlmsghdr *nlhdr, void *data)
>  						(autoneg == AUTONEG_DISABLE) ? "off" : "on");
>  		else
>  			print_bool(PRINT_JSON, "auto-negotiation", NULL,
> -				   autoneg == AUTONEG_DISABLE);
> +				   (autoneg == AUTONEG_DISABLE) ? false : true);
>  	}
>  	if (tb[ETHTOOL_A_LINKMODES_MASTER_SLAVE_CFG]) {
>  		uint8_t val;

The fix looks correct but isn't

	(autoneg == AUTONEG_DISABLE) ? false : true

just a more complicated way to say

	autoneg != AUTONEG_DISABLE

(and harder to read)?

Michal

Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ