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
_______________________________________________
systemd-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/systemd-devel