sock_diag.7: Fix recvmsg() usage in the example
commitbc766f2c0c7d9eb8bb64c1b22e723945e8abe33a
authorPali Rohár <pali@kernel.org>
Sun, 24 Jan 2021 15:10:39 +0000 (24 16:10 +0100)
committerMichael Kerrisk <mtk.manpages@gmail.com>
Mon, 25 Jan 2021 07:01:56 +0000 (25 08:01 +0100)
tree2dd521288c6cb12857bb3bc2b8c73bfe1d961217
parent29dee4ce10a37e069200623e2d581a18a673b37d
sock_diag.7: Fix recvmsg() usage in the example

The msg_name field for recvmsg() call points to a caller-allocated buffer
nladdr that is used to return the source address of the (netlink) socket.

As recvmsg() does not read this buffer and fills it for a caller, do not
initialize it and instead check its value in the example.

Signed-off-by: Pali Rohár <pali@kernel.org>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
man7/sock_diag.7