diff options
author | Thomas Graf <tgraf@redhat.com> | 2012-10-09 14:15:08 (GMT) |
---|---|---|
committer | Thomas Graf <tgraf@redhat.com> | 2012-10-09 14:16:54 (GMT) |
commit | e4192ff97f3fccbe8347e88139aca9ba49af29ab (patch) | |
tree | 0d68cae2f3ba9c72f94ed7c2e0f404c80b247d66 /lib/nl.c | |
parent | 72c2cb9e299b0510ae76e90b0b4fcc040ab485c7 (diff) | |
download | libnl-e4192ff97f3fccbe8347e88139aca9ba49af29ab.zip libnl-e4192ff97f3fccbe8347e88139aca9ba49af29ab.tar.gz libnl-e4192ff97f3fccbe8347e88139aca9ba49af29ab.tar.bz2 |
nl: Provide API to specify the default buffer size when receiving netlink messages
New functions:
nl_socket_set_msg_buf_size(sk, size)
nl_socket_get_msg_buf_size(sk)
Default remains getpagesize()
Signed-off-by: Thomas Graf <tgraf@redhat.com>
Diffstat (limited to 'lib/nl.c')
-rw-r--r-- | lib/nl.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -447,7 +447,7 @@ int nl_recv(struct nl_sock *sk, struct sockaddr_nl *nla, if (page_size == 0) page_size = getpagesize(); - iov.iov_len = page_size; + iov.iov_len = sk->s_bufsize ? : page_size; iov.iov_base = *buf = malloc(iov.iov_len); if (sk->s_flags & NL_SOCK_PASSCRED) { |