Re: [RFC PATCH net-next 04/10] ethtool: Add link extended state

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> @@ -108,6 +131,12 @@ static int linkstate_reply_size(const struct ethnl_req_info *req_base,
>  	if (data->sqi_max != -EOPNOTSUPP)
>  		len += nla_total_size(sizeof(u32));
>  
> +	if (data->ext_state_provided)
> +		len += sizeof(u8); /* LINKSTATE_EXT_STATE */
> +
> +	if (data->ethtool_ext_state_info.__ext_substate)
> +		len += sizeof(u8); /* LINKSTATE_EXT_SUBSTATE */
> +

This looks wrong. A u8 attribute takes up a lot more space than
sizeof(u8) because of the TLV overheads. That is what the
nla_total_size() is for.

		 Andrew



[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux