[systemd-devel] [RFC][PATCH] networkd: add a basic network daemon

Marcel Holtmann marcel at holtmann.org
Wed Nov 6 03:41:16 PST 2013


Hi Lennart,

>> +struct Link {
>> +        uint64_t ifindex;
> 
> Hmm is this really an uint64_t? if_nametoindex(3) suggestes it's an "unsigned"?

actually using if_nametoindex() is bad idea as well. That should be turned into an async RTNL call as well. We better just cache the ifname to ifindex mapping internally and then just do a lookup.

The problem with RTNL is that there are some global locks in there. So if you are really unlucky, then either glibc uses and ioctl that blocks and it uses internally netlink synchronously. If you serialize all RTNL netlink communication via asynchronous calls, then you never have to worry about that lock affecting you.

And for the ifindex type, the one that is communicated over RTNL netlink is the one that counts. Everything else is just some ancient leftover. And I bet you find tons of differences everywhere. I personally have not found a single truth.

Regards

Marcel



More information about the systemd-devel mailing list