[PATCH] Print route tables as an integer versus hex

David Ahern dsa at cumulusnetworks.com
Wed Apr 13 07:30:34 PDT 2016


On 4/12/16 6:53 PM, Thomas Haller wrote:
> diff --git a/libnl-3.sym b/libnl-3.sym
>> index 4e09bdd672a1..35df7206bcb4 100644
>> --- a/libnl-3.sym
>> +++ b/libnl-3.sym
>> @@ -350,4 +350,5 @@ libnl_3_2_27 {
>>   libnl_3_2_28 {
>>   global:
>>   	nl_object_diff64;
>> +	__list_table2str;
>>   } libnl_3_2_27;
>
>
> I know, __list_table2str is internal API and the name follows the
> pattern of existing function names.
>
> But as this is exported ABI, the name matters. Could we please rename
> it to have a "_nl" prefix? That differs from the existing naming
> pattern, but I think all functions (API or ABI) should have a proper
> "nl" prefix.

Frankly, I was a bit surprised by it being exported at all. Given that I 
did not want to change __list_type2str, so I added __list_table2str. I 
agree having a proper namespace prefix is best for code bases.

>
>
> While I'm bike shedding, could we rename the function some more?
> Basically, it's list_type2str which does hex conversion. It could be
> used for different cases then "rtnl_route_table2str", so the name
> should be more generic and indicate what the function does.
>
> How about one of:
>    "_nl_list_type2str_hex"
>    "_nl_list_type2hexstr"
>    "_nl_list_type2xstr"

Fundamentally, you have no issues with the table id in base 10 versus 
16. That's the patch we have in our tree. I will break out the broom for 
some spring cleaning when I get time (read weeks from now) and get back 
to you on the request above.




More information about the libnl mailing list