Python Netlink Multicast Communication in Kernels above 4

天涯浪子 提交于 2019-11-29 02:45:40

You forgot to bind the socket. :-)

I'm not very fluent with Python, so use this only as a starting point (between the socket and the setsockopt):

sock.bind((0, 0))

That prints me a bunch of garbage, among which I can see

Hello from kernel

By the way: When nlmsg_multicast() throws ESRCH, it's usually (or maybe always) because there were no clients listening.

First open the client, then try to send the message from the kernel.

Otherwise you can always ignore that error code it that makes sense for your use case.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!