[PATCH 2/4] Add new rtnl_link_af_data_compare function to compare af_data
Thomas Graf
tgraf at suug.ch
Mon Jan 14 03:02:02 EST 2013
On 01/13/13 at 03:09pm, Roopa Prabhu wrote:
> The reason i did not add this check because this api could be used
> for comparing IFLA_AF_SPEC too. In which case the IFLA_AF_SPEC
> family might not be same as l_family.
>
> Right now link_compare only compares IFLA_PROTINFO. But it could be
> extended to compare af_data belonging to IFLA_AF_SPEC as well.
>
> Let me know what you think.
OK, makes sense.
Please make the API more solid then and document the exact meaning
of the family parameter. As of now, an invalid family value will
be used blindly to index the ops array. Checking the return value
of rtnl_link_af_ops_lookup() would be enough already as it
enforces > 0 && < AF_MAX.
More information about the libnl
mailing list