int kernel_connect(struct socket *sock, struct sockaddr *addr, int addrlen, int flags) {

return sock->ops->connect(sock, addr, addrlen, flags);

A little care is required when the buffer space that takes received data or holds data that must be sent is specified. kernel_sendmsg and kernel_recvmsg do not access the data region directly via struct msghdr as in userland, but employ struct kvec. However, the kernel automatically provides a conversion between both representations as kernel_sendmsg shows.

Continue reading here: The Netlink Mechanism

Was this article helpful?

0 0