On Thu, 19 May 2022 at 23:28, Denis Kenzior <denkenz(a)gmail.com> wrote:
On 5/19/22 15:53, Andrew Zaborowski wrote:
> On Thu, 19 May 2022 at 22:28, Denis Kenzior <denkenz(a)gmail.com> wrote:
>>> Makes sense. How about using a global rtnl object for all of the
>>> l_netconfig objects? Do you still prefer that it be passed from
>> I have no real preference on whether it is passed in from the outside vs not.
>> But, there's another thing to consider here. Today the call to
>> is used determine whether the dhcp/icmp/dhcp6 object should set everything up
>> directly vs letting the outside layer do this. With l_netconfig I don't
>> this is a problem per se, but you should consider the other classes when you
>> design this.
> Right but with l_netconfig you make this choice by either calling
> l_netconfig_apply_rtnl or not, and you shouldn't call l_foo_set_rtnl
> on the underlying dhcp/icmp objects.
Sure, but are you assuming we will not have any further classes using rtnl
>> We can start by trying to come up with a nice ell API for obtaining the
>> singleton rtnl object and go from there.
> The global rtnl object I meant is to be used only by l_netconfig
> instances so there's no need for a getter, or I'm misunderstanding
> what you're saying.
We use rtnl all over the place in iwd, like netdev, p2p, ap, etc. All these +
netconfig should share the same one.
That's different than what I did in patch 11/17 but it would work.
I'll put it in rtnl.c then, with a _get() and a _put() since we have
no generic refcounting for l_netlink.