Subject: Re: [PATCH iproute2-next 11/15] lib: Extract from iplink_vlan a helper to parse key:value arrays

From: Petr Machata <[email-masked]>
Date: Tue, 20 Oct 2020 22:44:31 +0200

Roman Mashak <[email-masked]> writes:

> Petr Machata <[email-masked]> writes:
>
>
> [...]
>
>> +static int parse_qos_mapping(__u32 key, char *value, void *data)
>> +{
>> +	struct nlmsghdr *n = data;
>> +	struct ifla_vlan_qos_mapping m = {
>> +		.from = key,
>> +	};
>> +
>> +	if (get_u32(&m.to, value, 0))
>> +		return 1;
>> +
>> +	addattr_l(n, 1024, IFLA_VLAN_QOS_MAPPING, &m, sizeof(m));
>> +	return 0;
>> +}
>
> addatr_l() may fail if netlink buffer size is not sufficient, may be:
>
> return addattr_l(...);
>
> would be better.

Ack, makes sense to fix this since I'm moving the code around anyway.