summaryrefslogtreecommitdiffstats
path: root/lib/nl.c
diff options
context:
space:
mode:
authorThomas Graf <tgraf@redhat.com>2012-10-09 14:15:08 (GMT)
committerThomas Graf <tgraf@redhat.com>2012-10-09 14:16:54 (GMT)
commite4192ff97f3fccbe8347e88139aca9ba49af29ab (patch)
tree0d68cae2f3ba9c72f94ed7c2e0f404c80b247d66 /lib/nl.c
parent72c2cb9e299b0510ae76e90b0b4fcc040ab485c7 (diff)
downloadlibnl-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.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/nl.c b/lib/nl.c
index ea3e087..5b37c2a 100644
--- a/lib/nl.c
+++ b/lib/nl.c
@@ -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) {