[PATCH v2] Add VRF support

David Ahern dsa at cumulusnetworks.com
Wed Oct 21 10:33:20 PDT 2015


On 10/21/15 10:12 AM, Beniamino Galvani wrote:
> On Tue, Oct 20, 2015 at 07:10:35PM -0700, David Ahern wrote:
>> v2
>> - add symbol export
>> - additional error checking in vrf support
>> - enhanced test to use all APIs
>>
>
>> +static int vrf_parse(struct rtnl_link *link, struct nlattr *data,
>> +		     struct nlattr *xstats)
>> +{
>> +	struct nlattr *tb[IFLA_VXLAN_MAX+1];
>
> IFLA_VRF_MAX
>

yes. will fix

>> +	struct vrf_info *vi;
>> +	int err;
>> +
>> +	NL_DBG(3, "Parsing VRF link info");
>> +
>> +	if ((err = nla_parse_nested(tb, IFLA_VRF_MAX, data, vrf_policy))< 0)
>
> Nitpick: add space before '<'.

ok

>
>> +int rtnl_link_vrf_set_tableid(struct rtnl_link *link, uint32_t id)
>> +{
>> +	struct vrf_info *vi = link->l_info;
>> +
>> +	IS_VRF_LINK_ASSERT(link);
>> +	if(id > VRF_TABLE_ID_MAX)
>> +		return -NLE_INVAL;
>
> Isn't VRF_TABLE_ID_MAX the maximum value allowed for uint32_t?

forgot to set it to the right value -- RT_TABLE_MAX.

will send v3. thanks for the review




More information about the libnl mailing list