[systemd-devel] The enum udev_monitor_netlink_group contains bit masks
avagin at gmail.com
Tue Mar 12 22:09:08 PDT 2013
2013/3/13 Kay Sievers <kay at vrfy.org>
> On Tue, Mar 12, 2013 at 9:35 PM, Andrey Wagin <avagin at gmail.com> wrote:
> > According to netlink(7) nl_groups is a bit mask with every bit
> > a netlink group number.
> Netlink uses "numbers" not "a mask" since many years, we have just a
> 32bit number, not 32 groups today. The man page should really be
> There might be magic for group 1-32, which is still in place, but
> there is generally no mask anymore for netlink groups.
I'm afraid, you are wrong. This patch is about kernel internals.
User-interfaces have not been changed.
nlk->dst_group = ffs(nladdr->nl_groups);
Here is another patch, which expands user interface to set more than 32
> > I found that constants from udev_monitor_netlink_group are set directly
> > nl_groups. It's dangerous. Currently this enum contains only three
> > and all is ok, but the next constant will be incorrect.
> There will probably never be another netlink group inside libudev. If
> we ever change that low-level stuff here, we would move entirely to a
> kernel dbus facility, and not (mis-)use netlink anymore.
It's not a reason to not fix this code. People use code of system tools as
examples. I usually do that. It's the most probable place where kernel
interfaces are used by the right way.
> > I created a patch, but I have not tested it. It's just idea. Sorry, I
> > have prefered to avoid investigation of how to execute my system with
> > systemd. So if someone wants to fix this issue, you are welcome.
> Just build systemd locally, and run
> ./udevadm monitor
> locally, it will receive messages from the kernel and from the already
> running and unchanged udevd. Just plub/unplug any device.
> If the output is the same in the local build and the one from the
> system, all is fine, you can check with strace to verify the details
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the systemd-devel