Subject: Re: [PATCH iproute2-next 2/2] tc: q_red: Support 'nodrop' flag

From: Petr Machata <[email-masked]>
Date: Mon, 23 Mar 2020 11:20:19 +0100

David Ahern <[email-masked]> writes:

> On 3/18/20 6:18 AM, Petr Machata wrote:
>> @@ -154,6 +161,7 @@ static int red_parse_opt(struct qdisc_util *qu, int argc, char **argv,
>>  	addattr_l(n, 1024, TCA_RED_STAB, sbuf, 256);
>>  	max_P = probability * pow(2, 32);
>>  	addattr_l(n, 1024, TCA_RED_MAX_P, &max_P, sizeof(max_P));
>> +	addattr_l(n, 1024, TCA_RED_FLAGS, &flags_bf, sizeof(flags_bf));
>
> the attr is a bitfield32 here ...
>
>>  	addattr_nest_end(n, tail);
>>  	return 0;
>>  }
>> @@ -183,6 +191,10 @@ static int red_print_opt(struct qdisc_util *qu, FILE *f, struct rtattr *opt)
>>  	    RTA_PAYLOAD(tb[TCA_RED_MAX_P]) >= sizeof(__u32))
>>  		max_P = rta_getattr_u32(tb[TCA_RED_MAX_P]);
>>
>> +	if (tb[TCA_RED_FLAGS] &&
>> +	    RTA_PAYLOAD(tb[TCA_RED_FLAGS]) >= sizeof(__u32))
>> +		qopt->flags = rta_getattr_u32(tb[TCA_RED_FLAGS]);
>> +
>
> but a u32 here. These should be consistent.

:-/ That's a leftover from previous ABI, thanks for catching it.
Will send a v2.