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: <035ed67a-9da1-7023-853f-d5e62bb3f41b@intel.com>
Date:   Mon, 27 Jul 2020 14:27:56 -0700
From:   Jacob Keller <jacob.e.keller@...el.com>
To:     Michal Kubecek <mkubecek@...e.cz>, Andrew Lunn <andrew@...n.ch>
Cc:     Jamie Gloudon <jamie.gloudon@....fr>, netdev@...r.kernel.org
Subject: Re: Broken link partner advertised reporting in ethtool



On 7/27/2020 2:08 PM, Michal Kubecek wrote:
> On Mon, Jul 27, 2020 at 11:01:41PM +0200, Andrew Lunn wrote:
>>>   - the exact command you ran (including arguments)
>>>   - expected output (or at least the relevant part)
>>>   - actual output (or at least the relevant part)
>>>   - output with dump of netlink messages, you can get it by enabling
>>>     debugging flags, e.g. "ethtool --debug 0x12 eth0"
>>  
>> Hi Michal
>>
>> See if this helps.
>>
>> This is a Marvel Ethernet switch port using an Marvell PHY.
> 
> Thank you. I think I can see the problem. Can you try the patch below?
> 
> Michal
> 

I think the patch below fixes part of the issue, but isn't completely
correct, because NOMASK bitmaps can be sent in compact form as well.

Also, we'll need something to check the NOMASK flag and do the correct
thing in all of the dump functions.

Thanks,
Jake

> 
> diff --git a/netlink/settings.c b/netlink/settings.c
> index 35ba2f5dd6d5..60523ad6edf5 100644
> --- a/netlink/settings.c
> +++ b/netlink/settings.c
> @@ -280,6 +280,7 @@ int dump_link_modes(struct nl_context *nlctx, const struct nlattr *bitset,
>  	const struct nlattr *bit;
>  	bool first = true;
>  	int prev = -2;
> +	bool nomask;
>  	int ret;
>  
>  	ret = mnl_attr_parse_nested(bitset, attr_cb, &bitset_tb_info);
> @@ -338,6 +339,7 @@ int dump_link_modes(struct nl_context *nlctx, const struct nlattr *bitset,
>  		goto after;
>  	}
>  
> +	nomask = bitset_tb[ETHTOOL_A_BITSET_NOMASK];
>  	printf("\t%s", before);
>  	mnl_attr_for_each_nested(bit, bits) {
>  		const struct nlattr *tb[ETHTOOL_A_BITSET_BIT_MAX + 1] = {};
> @@ -354,7 +356,7 @@ int dump_link_modes(struct nl_context *nlctx, const struct nlattr *bitset,
>  		if (!tb[ETHTOOL_A_BITSET_BIT_INDEX] ||
>  		    !tb[ETHTOOL_A_BITSET_BIT_NAME])
>  			goto err;
> -		if (!mask && !tb[ETHTOOL_A_BITSET_BIT_VALUE])
> +		if (!mask && !nomask && !tb[ETHTOOL_A_BITSET_BIT_VALUE])
>  			continue;
>  
>  		idx = mnl_attr_get_u32(tb[ETHTOOL_A_BITSET_BIT_INDEX]);
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ