Subject: Re: [iproute2 04/22] tc/tc_util: Read class names from provided path, /etc/, /usr

From: Petr Machata <[email-masked]>
Date: Thu, 20 Jul 2023 13:33:50 +0200

Gioele Barabucci <[email-masked]> writes:

> On 20/07/23 12:10, Petr Machata wrote:
>>> diff --git a/tc/tc_util.c b/tc/tc_util.c
>>> index ed9efa70..e6235291 100644
>>> --- a/tc/tc_util.c
>>> +++ b/tc/tc_util.c
>>> @@ -28,7 +28,8 @@
>>>     static struct db_names *cls_names;
>>>   -#define NAMES_DB "/etc/iproute2/tc_cls"
>>> +#define NAMES_DB_USR "/usr/lib/iproute2/tc_cls"
>>> +#define NAMES_DB_ETC "/etc/iproute2/tc_cls"
>> Is there a reason that these don't use CONF_USR_DIR and CONF_ETC_DIR?
>> I thought maybe the caller uses those and this is just a hardcoded
>> fallback, but that's not the case.
>
> Thanks for the review Petr.
>
> The reason why I did not use CONF_USR_DIR in these patches is because I wanted to minimize the
> number and amount of changes. But I asked myself the same question when I first looked at this and
> other similar occurrences.
>
> Let me know if I should update the patches to use CONF_{USR,ETC}_DIR.

The change would make sense to me, it looks like rest of the code tends
to use those defines. But it should probably be sent separately, yeah.