Kernel thread and netlink

Thomas Graf tgraf at suug.ch
Mon Nov 12 06:23:37 EST 2012


On 11/12/12 at 11:10am, Gareth Williams wrote:
> Thanks for getting back to me on this.
> 
> I need to clarify what I mean by "bridge changes": I mean bridge forwarding entry (table) changes.
> 
> My application needs to monitor these changes while processing packets quickly (hence in the kernel).
> 
> Bridge table events are sent over its netlink socket but it looks like I cannot create a kernel thread netlink socket to monitor them.
> 
> I am left with either bouncing this information from a user space app or implementing a new notifier mechanism for bridge table entries..
> 
> So, just to be sure on this, it is not possible for a kernel thread to create a netlink socket that can connect to a kernel netlink socket?

The only limitation that I can see is the kernel assuming port == 0
implies a kernel socket which you have already mentioned. It shouldn't
be hard to get this fixed and allow for kernel - kernel communication
but it's definitely not possible with the status quo of the
implementation. I would be willing to help out with the needed changes
as I see general benefits in such a capability.

If you want to rely on current kernel semantics the only way I see it
is to listen in user space and convert events to a set of actions that
you can redirect back to your kernel module via generic netlink.

Hope this helps.



More information about the libnl mailing list