Can reading / writing the NETLINK jack never work?

I assume that a kernel panic or something that could be catastrophic could happen, but otherwise, is it possible that an error sending or returning to the NETLINK socket would occur due to an error?

+4
source share
1 answer

Given that the socket point AF_NETLINK should communicate with the kernel, it is theoretically possible to theoretically call send for failure, since the kernel will check the data transmitted to it and may decide that the data is nonsense and reject send (with any errno that it likes).

More practical, since you are pointing to a data pointer, you can specify an invalid pointer (as with any send or recv call) and get an immediate EFAULT error.

If the recv buffer is valid and large enough, recv usually not be interrupted (except for things like EINTR ).

I assume that you can get a more specific answer with more specific code.

+2
source

Source: https://habr.com/ru/post/1401502/


All Articles